Posts relating to
WordPress development
3 Ways to Improve PageSpeed by Moving jQuery to the Footer of a WordPress site.
October 27th, 2020Here’s how to improve your site’s rating on Google’s PageSpeed by moving render-blocking jQuery to the footer. If you’ve ever tried to improve a site’s performance on Google’s PageSpeed, you’ve probably seen that one of the “Opportunities” is to “Eliminate render-blocking resources”. These resources are typically CSS and JavaScript files. Usually, it’s not easy to […]
How to Move a Meta Box in WordPress
August 2nd, 2020Sometimes you want to programmatically move a WordPress meta box to a more ideal position on the editor screen. Here’s my way, with code.
Ordering nested comments by the latest reply
June 25th, 2020WordPress orders its comments by oldest or newest first. So how do you go about ordering nested comments by the age of respective replies?
How to Remove HTML Comments from the Page Source
February 20th, 2020Many plugins (and themes) inject HTML comments into the page’s source code that aren’t really needed in your a live site. Here’s how to remove them.
Extracting Thumbnails from Videos
February 18th, 2020Recently, I’ve had a couple of projects that require thumbnails for video posts. There are plugins out there to do this, but I wanted a simple, lightweight way. Good news is, this can be achieved very easily by making use of WordPress’s WP_Embed class. /** * Maybe get thumbnail from embed * * @param string […]
How to Remove Meta Boxes from Specific Pages
July 2nd, 2019Sometimes you only want WordPress meta boxes, such as the permalink, on specific pages. To do so you can remove meta boxes from certain pages.
Remove menu link types from the WordPress menu options screen
November 13th, 2018On a client site, we wanted to restrict menu items to Custom Links, only. Thus remove all other menu types. The main drive behind this was to improve the user experience and reduce confusion, as the menu is only for Social Links. With a brief search yielding very little I set about coding a solution, […]
How to break long words using CSS @supports
November 7th, 2018Recently, I had an odd scenario where wrapping long text needed either word-wrap, overflow-wrap or word-break to achieve the same overflow pattern across different browsers. To arrive at a suitable solution I opted to use @supports to maintain control of the declarations. What is @supports? @supports is a feature query, whose associated block of statments […]
Conditionally enqueue scripts and stylesheets on specific pages
November 3rd, 2018There are many use-cases where scripts and stylesheets only need to be loaded on certain pages. One such example would be to only load the JavaScript and CSS stylesheets for Contact Form 7 (a lightweight contact form plugin) on the contact page. This article will demonstrate how to conditionally load the JS and CSS for […]
Using LD+JSON Schema to Enhance SEO for Blog Posts
November 1st, 2018Schema markup helps search engines understand your content by describing its primary purpose, in a machine-friendly way. The most recent, and in my opinion, the easiest to maintain, is ld+json, which is contained in a script tag, proving the search engines with the key data. What does ld+json markup look like? The best way to […]