Hi, i’m Phil
a creative problem solver.
-
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:
-
Enabling vCard Uploads in WordPress with upload_mimes Hook
If you need to allow vCard file uploads to your WordPress site, you can use the upload_mimes hook to add vCard file formats to your list of allowed mime types. In this blog post, we’ll show you how to use this hook and provide a code example that you can use in your custom or […]
Published:
Category:
Tags:
-
Death By (Exercise Rep Calculator)
A small javascript calculator for determining the number of reps completed during a “Death By” EMOM workout. https://codepen.io/philhoyt/pen/bGpGLeN
Published:
Category:
Tags:
-
How I am styling Select elements
I’ve complained about styling forms before on this blog. But things have gotten better over the last several years and we are starting to see some browser consistency. I did run into a problem with select elements to find that adding pseudo classes won’t work, which is my usual go to for adding font icons […]
Published:
Category: