0
Use the code below to display posts from the ID 1, however, instead of using the ID category, I would like to use the Slug EX: cat=news
<?php query_posts('cat=1'); while ( have_posts() ) : the_post(); ?>
0
Use the code below to display posts from the ID 1, however, instead of using the ID category, I would like to use the Slug EX: cat=news
<?php query_posts('cat=1'); while ( have_posts() ) : the_post(); ?>
1
According to the wordpress documentation, I believe this solves your problem:
query_posts( array(
'category_name' => 'my-category-slug',
'posts_per_page' => -1
) );
Browser other questions tagged wordpress wordpress-theme
You are not signed in. Login or sign up in order to post.