Righton
Member
Posted 7 years ago #
I am converting my website over to WP and have a couple questions...
I only have two pages (Contact and Resumé) that will be static. The other three pages need to contain post content (Index, Icons, and Portfolio).
My question is, is there a way to duplicate my index.php to two other .php files and limit the output to only a certain category... (i.e. - index only displays posts in category 'main' and icons only shows posts in category 'icons')?
I read over on another blog that such a thing USED to be doable before 1.5... is it able to be done now?
I'm pretty sure you can still do this with query_post. Try searching with that keyword and see what you can find.
Righton
Member
Posted 7 years ago #
I'm assuming you're referencing this
<?php query_posts('p=-1');?>
If this is correct, where do I put it for it to take effect?
I tried <?php query_posts('cat=1');?> in my index.php but no luck
And another one that examines a variety of ways to use the WordPress Loop to generate different results at http://codex.wordpress.org/The_Loop_in_Action
Righton
Member
Posted 7 years ago #
I looked into the query_post info, but it seems, no matter where I place that code, it doesn't seem to want to work.
The Code I'm using is <?php query_posts('cat=1');?> and I'm trying to use it in my index.php