Need urgent help with wordpress!

Discussion in 'WordPress' started by niravdave, Jan 28, 2009.

  1. #1
    I would like to display different number of post in different categories. My current code on category.php is

    <?php if ( is_category(array(2,37)) )
    {
    include(TEMPLATEPATH . '/category1.php');
    }
    else
    {
    include(TEMPLATEPATH . '/archive.php');
    }
    ?>


    All i want to do is integrate the code below with category1 above, but do not how to do it.

    <?php query_posts('category_name=special_cat&showposts=10'); ?>

    help highly appreciated.

    nirav
     
    niravdave, Jan 28, 2009 IP
  2. lvtim

    lvtim Well-Known Member

    Messages:
    291
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    130
    #2
    Is this what you're trying to accomplish?

    If category id = 2 or 37
    then include category1.php
    and display query_post code
    else
    include archive.php
    end if

    If so, then it should look like this:

    <?php if ( is_category(array(2,37)) )
    {
    include(TEMPLATEPATH . '/category1.php');
    query_posts('category_name=special_cat&showposts=10');
    }
    else
    {
    include(TEMPLATEPATH . '/archive.php');
    }
    ?>
     
    lvtim, Jan 28, 2009 IP
  3. mizaks

    mizaks Well-Known Member

    Messages:
    2,066
    Likes Received:
    126
    Best Answers:
    0
    Trophy Points:
    135
    #3
    Custom Query String didn't work for you?
     
    mizaks, Jan 28, 2009 IP
  4. niravdave

    niravdave Active Member

    Messages:
    675
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    88
    #4
    hey that did not work for me for some reason. All i m trying to achieve is display different number of posts on different category

    for e.g.

    category1 - i want to display only 8 posts where as in

    category2 - i want to display 20 posts.

    cheers
    nirav


     
    niravdave, Jan 29, 2009 IP