-
How to exclude empty pages from WordPress Search Results
Pages with no content can appear in search results. To address this issue, I used the ‘pre_get_posts’ function to exclude any ‘post’ with an empty ‘post_content’ field from the search query. Here’s the code I used:
Published:
Category:
Tags:
-
How to add a User Role for ‘Client’s to WordPress
The Client Role Plugin is a simple WordPress plugin that when activated creates a new user role called ‘Client’. This plugin is useful for website owners who want to provide limited access to clients or collaborators without giving them full administrative access. This role will have the same capabilities as the ‘Administrator’ role, However, the […]
Published:
Category:
Tags:
-
Easy Related Posts WordPress Query
If you’re building a WordPress website, you may come across a scenario where you need to display related posts based on the current post’s category. This is a common requirement for blog posts and other content-rich websites. The good news is that you can easily achieve this using WordPress’s built-in “WP_Query” class. This class allows […]
Published:
Category:
Tags: