its easy to get the WordPress posts by Category name. That means your posts will only display if the post has selected a specific category.
To create a category:
Go to admin panel posts –> Category
Type category name and click on Add new category.
See screenshot:
NOW . Go to Add a new post. Add new post here and select the category which you have created with the name.
See screenshot:
TO DISPLAY THE POSTS WITH THE CATEGORY NAME
Just put your category name which you have created in place of CATEGORYNAME.
1 2 3 4 5 6 7 8 9 10 |
<!--?php query_posts('category_name=CATEGORYNAME&showposts=5'); while (have_posts()) : the_post(); ?--> the_title(); // To display the title of all posts that have category name selected the_content(); // To display the content of all posts that have category name selected <!--?php endwhile; ?--> |
That’s it. Just copy and paste in any of your template files to display the posts.
Here you can Submit A Guest Post for all the categories.