php - How to get all posts with one category on one page in wordpress? -


i new in wordpress. have make template post. don't know how posts 1 category on 1 page in wordpress. can please me sort out problem?

try below code. can add category id , post per page want.

 <?php $catquery = new wp_query( 'cat=3&posts_per_page=10' ); while($catquery->have_posts()) : $catquery->the_post(); ?> <ul> <li><h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>  <ul><li><?php the_content(); ?></li> </ul> </li> </ul> <?php endwhile; ?> 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -