Tag: PHP

How to Add Pageviews Count Column to WordPress Posts, Pages, and Custom Post Types

Tracking pageviews is an important aspect of managing a website. In this tutorial, we will explore how to add a “Pageviews” count column to WordPress posts, pages, and custom post types. This feature allows you to keep track of the number of views each content item receives, providing valuable insights into your site’s popularity. Additionally, […]

How to Add Related Posts to Your WordPress Site Without Plugins – A Simple Guide

If you want to keep your readers engaged and interested in your content, one way to do it is by showing them related posts. Luckily, WordPress has a built-in function called get_posts() that can help you fetch related posts based on the current post’s categories and tags. Before making any changes to your WordPress theme, […]

How to Create a Shortcode in WordPress to Count All Posts with Some Categories Excluded

If you’re looking for a way to count all posts on your WordPress site while excluding posts in specific categories, a shortcode is a great solution. By creating a shortcode, you can easily display the post count wherever you want on your site, such as in a page, a post or widget and navigation menu. […]

Fix WordPress Internal Server Error (500 Error): A Step-by-Step Guide with Examples

The Internal Server Error (500 error) is one of the most common and frustrating errors that can occur on a WordPress website. It can be caused by a number of issues, including incorrect file permissions, plugin conflicts, or even a corrupted .htaccess file. In this tutorial, we will provide step-by-step instructions and code examples to […]

The Simplest Way to Add Related Posts to Your WordPress Site Without Plugins

The Simplest Way to Add Related Posts to Your WordPress Site Without Plugins

Creating your own Related posts for WordPress custom post types or for your blog isn’t that hard. You can use my example code below to set it up. Before we start, I assume you already have experience with editing PHP and working with your WordPress child theme. Also check the new post about adding related […]