Life in Code: Coding
Code snippets and development discoveries
Outputting a Post Excerpt : WordPress Code Snippet
A simple helper function that I use in most WordPress websites to output a short description or summary of a post. This will use the post excerpt content in full if it has been defined for the post, or return…
Read more
Output Users of a Specific Role in the Yoast Sitemap : WordPress Code Snippet
The following code will only return authors of a specific role from the generated Yoast XML sitemap. In the example, users of the 'editor' role are returned. Add the following to your functions.php file: /** * Filter Yoast authors -…
Read more
Custom WP_Query SQL WHERE Clause using posts_where : WordPress Code Snippet
There may be times when you need to add to the WHERE clause within a WP_Query call for additional SQL filtering that cannot easily be achieved via the standard parameters. The following is a simple example that passes through a…
Read more
Sections
-
Coding
Code snippets and development discoveries
-
Fitness
Weightlifting and my personal training accountability
-
Freelancing
Business progress and learnings
- All Posts