Posts relating to
WordPress
Using Gutenberg and/or the Classic Editor
December 7th, 2018It’s common knowledge that WordPress’s new editor, codenamed Gutenberg, will shake up the landscape for many, many websites that use the awesome platform. For some of us it’s a welcomed step for WP, however, for others, it is not. Yet. For Web agencies and freelance developers this is just a hurdle (albeit a potentially big […]
Getting your plugins ready for Gutenberg
December 5th, 2018Is your site, its plugins, custom post types, custom meta and your content ready for Gutenberg? Remember the release date: 5th 6th 7th December 2018. TL;DR Until you’ve tested everything, a short-term fix could be to turn off the Gutenberg experience: add_filter('use_block_editor_for_post', '__return_false'); If you own, manage, develop or have any vested interest in a […]
Toggle Navigational Menus and Submenus Using Pure JavaScript
November 28th, 2018We had an interesting challenge today, where we needed to create a collapsible, responsive menu and sub-menu, using pure JavaScript. Normally this functionality would be part of a frontend framework, but the client’s site doesn’t use any so, rather than using one solely for this functionality, we decided a clean and efficient way would be […]
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 […]
Nesting CSS Media Queries
October 28th, 2018Processing styling rules based on certain criteria, such as viewport width, is achieved using the @media conditional group rules. As of October 2018, all modern browsers support nested @media queries. What’s a @media query? Here’s a simple example of a media query to make the text 10% bigger on devices with a screen (viewport) wider than 768px […]
Adding Feature Images to the WordPress RSS Feed
October 26th, 2018The WordPress RSS feed is great. We use it with third-party services, such as MailChimp. One key datum that isn’t included in the feeds by default is the featured image for posts (and pages). This article will address that with a simple ‘action‘ hook that adds the featured image to the item’s feed. /** * […]
How to trim words by character limit
October 21st, 2018We recently encountered a scenario where the client wanted to trim the news items titles to a maximum number of characters, whilst respecting words. Our research revealed that this seemingly obvious requirement wasn’t elegantly solved. As most of you will know, there are solutions for trimming by characters or trimming by words, but neither of […]