We would like to know the WordPress more about WordPress Category print and then print Post in selected category.
Like in this style
<h2>Categories Name 1</h2>
<ul>
<li>Post1</li>
<li>Post2</li>
<li>Post3</li>
<li>Post4</li>
</ul>
<h2>Category Name 2</h2>
<ul>
<li>Post1</li>
<li>Post2</li>
<li>Post3</li>
<li>Post4</li>
</ul>
WordPress provides a function to return all categories (
get_categories()) and a function to list all posts of a category (WP Queryobject).With the combination of the two, you can create the output you would like to do. The following is some example code that can be extended / changed with the parameters you need: