How to post to page (other than home) based on category
-
Hi,
I am trying to have some posts appear on a page other than the home page, based on the category ID of the posts (I currently have a feed automatically posting stories to my homepage – would like to divert some to another page).
I read a WP post that said to insert this line of code: <?php query_posts(‘cat=-x’); ?> (where x=category #) before <?php if ( have_posts()… in the index.php file. However, when I did that, it did exclude the category posts specified, but some of my other pages did not load correctly. I’m not a developer, so I’m not sure what is wrong or how to fix it.
Is this the best way to accomplish this, or is there a better way to go about this? If this is the way to do it, where should I put the code, or does it need to be changed at all?
Any help would be greatly appreciated!
- The topic ‘How to post to page (other than home) based on category’ is closed to new replies.