treehouse : what would you like to learn today?
Web Design Web Development iOS Development

running 2 loops?

  • so here is my problem. I am doing a blog for a radio dj/ tv host/ writer. He wants his tv show which is posted on vimeo to have its own page. so i created 2 different blogrolls running to loops. the problem in lies. I want the tv show blog roll to only show the specific category which is mergeoutloud. I was able to do that by useing this this peace of code
    <?php
    query_posts('category_name=mergeoutloud');
    ?>


    now my problem is that on the home pages blog i do not want the merge out loud posts to show up there. I tried
    using this

    <?php 
    query_posts('cat=-2');}?>


    to exclude the category but it doesn't seems to work... and yes that it is the right category number. Ive tried a few different configurations that take the merge out loud posts off the home blog but then when u go to view older posts it shows the same to most recent.

    anyone got any ideas i am ready to pull my hair out please help!

    the website is sethtowerhurd.com
  • You've got an extra curly bracket in there, should be:
    <?php query_posts('cat=-2'); ?>
  • removed it but still doesnt seem to be working any other ideas?
  • Try:

    <?php query_posts('cat!=2'); ?>


  • Please show us the whole code for the home page, that will help us dissect the problem.
  • Nice looking site there. Anyway, first always check the Codex for other answers before asking, it's the best way to learn. If you tried other avenues then make a note of it. ;)

    Now, give this a try:
    query_posts(array('category__not_in' => 2));

    If that's not working either double check the category ID or just post the index.php code.