The count_user_posts is a wordpress function that returns the number posts created by a user
It requires three parameters to attain count all author posts
Each parameter performs specific task
Inside, there is brief description of each parameter
Let’s dive in now
Continue Reading
The wp_enqueue_styles can output the stylesheet with custom attributes.
However, the arguements of wp_enqueue_styles cannot add the attributes to a link tag
So, you should use WP_Styles’s method add_data to put attribute to style tag
Therefore, this post shows how add_data adds attribute to a wp_enqueue_styles
But also, you will add attribute to a stylesheet using style_loader_tag hook
Let’s get started now
Continue Reading
Does your blog posts use tags, category slug, or any custom taxonomy?
If the answer is YES, then it is a good idea to fetch the number of posts in the post type using custom taxonomy
Inside the article, you will learn how to implement WP_Query, wp_count_posts and get_posts to get number of custom post type posts
If you want to count the number of posts in the custom post type, this post has tips for that
Please read the guide to count all category posts
Continue Reading
The wp_head always adds many scripts including unused stylesheets. The wp_head is very essential because it is used by plug-ins to include the libraries and plug-in script. So, you can’t remove the function but the unrequired stylesheet can be removed. One of the styles you may want to get rid of it is style.css. A wp_dequeue_style is able to remove […]
Continue Reading
Inside the article, you will find how get_the_title receives the ID to show the title of the page(post)
The article covers the best practise to display the title when the id is used.
But what is the other the function that accepts the post id?
get_post.
If you read the entire article, you will be able to use get_post to get post title by id
Dive in now to find out how the title can be retrieved using the integer
Continue Reading