Skip to main content

Load an AJAX PHP file from WordPress

On my website, I have a caching plugin called WP Rocket, which is an awesome plugin, but one downside is that if you have dynamically generated content, it will be cached.
For example, on my website, I have a cool PHP widget that figures out the current time, and then displays a message based on the time. With caching, that plugin will no longer be dynamic because it will just show the result from the time that it was cached.

(more…)

WordPress taxonomy terms and comments count showing zero after import

A client recently needed me to migrate a lot of posts and tags to WordPress from a different CMS.
After importing all of the tags and posts to WordPress, I noticed that If I went to the tags page, all of the tags were listed, but they were all showing as ‘0’ even though the tags were assigned to posts. This was specifically used for a custom post type and custom taxonomy.
(more…)

Replace WordPress post date with hours and days

Today I found a really cool and simple way to change your WordPress post archive to display how long ago the post was made as opposed to the date. It gives your visitors a very fast indication that the post is new so they don’t have to think twice about today’s date.

So, basically instead of the post saying “Posted 10/10/16” – it will say, “Posted 2 hours ago”, or “Posted 2 Days ago” etc.
(more…)