Hiding street numbers is pretty easy. Just use this style code: [ { “featureType”: “administrative.land_parcel”, “stylers”: [ { “visibility”: “off” } ] } ] The full embed code would look something like this: View this gist on GitHub
Category: Web Development
Yoast SEO really slow in WordPress backend Edit Page area
So Yoast SEO was running REALLY slow, like 2 minutes slow. Turns out it renders page content via wp_ajax and then parses this content via javascript. This is very problematic if a certain shortcode renders lots of content on the frontend (in my case it was a job board/map search shortcode thing). A quick fix is […]
php_network_getaddresses: getaddrinfo failed: Name or service not known
If your PHP script is reporting this error (or generally unable to connect to hosts) then you may need to restart Apache/PHP-FPM/Entire Server after a recent glibc security update. More details: https://twitter.com/rossey/status/844857622230556672
How to run PhantomJS from PHP
I was adding PhantomJS into an existing PHP script and running passthru(‘phantomjs …..’); just wasn’t working. A few tips: If you’re running the script locally, add export DISPLAY=:0 to the PHP passthru() If you’re running the script on a remote host make sure someting like Xvfb is installed, then run nohup Xvfb :40 -ac -screen 0 1600x4000x24 & […]
Just passed 6000 installations on Hosted-Demo!
Five months ago I created hosted-demo.net as a way to allow my customers backend access to WordPress themes before purchase. This tool gave customers a temporary 1 hour website to test all the features of the theme and confirm it will suit their needs before buying. To view an example of our live theme demo pages please go here: http://dtbaker2.theme-demo.net […]
Automatic Visual Regression Testing on WordPress Themes
So the other day I discovered a plugin update broke one of my theme demo websites. The layout on this particular demo page was probably broken for a good week. How can I stop this happening again? Automatic Visual Regression Testing! This basically means “take screenshots of web pages and report any visual differences”. Cool hey! […]
jQuery Timepicker with unix epoch
The jQuery UI Timepicker is pretty cool. Adds a nice little time selector under the existing jQuery Date Picker calendar. I needed to read/write timestamps from fields like this: <input type=”text” name=”something” class=”date_time” value=”1477569840″> So I came up with this simple solution: $(‘.date_time’).each(function(){ // create a new hidden field for our epoch time storage. // copy […]
WP Tip: Paste a link while highlighting text
I didn’t know about this quick way to add a link to text. Just copy the link and paste it while highlighted. Saves clicking the add link button.
Adding extra fields to an existing Elementor widget
Following on from creating your own Elementor widgets it is possible to add extra fields to existing widgets. Again there are no hooks or filters for this, we’ll be interacting with the Elementor class directly. View this gist on GitHub Pretty easy.