Forums

query_post array (3 posts)

  1. stephanM
    Member
    Posted 3 years ago #

    it's maybe easy for php aces :

    i have 4 categories : "band1"(id=2) "biography"(id=3) "records"(id=4) "news"(id=5)

    i would like to create a template category page for band1 so i call it "category-2.php"

    In it i would like a biography, the records they have made, and the last news about them.

    So after a quick search in the codex, my choice is for the query_post method.

    I try to display the "records" released by "band1", it works fine with <? query_posts(array('category__and' => array(2,4)));
    ?>
    but now i would like to add the "bio" of the band1 and the "last news".
    So i write after the first query post array, a second one like this :
    <? query_posts(array('category__and' => array(2,3)));
    ?>
    this second query_post array reset my previous one (wich was displaying the records).

    So i think i have a php array syntax problem and i'm sure that i can display what i want in a single line of query_post(array) !

    Now i'm looking for the good pal to help me :)

    thanx for your help !

  2. MichaelH
    Volunteer
    Posted 3 years ago #

    Consider using the template tag, get_posts(), instead of query_posts. It accepts the same parameters listed in the query_posts() article.

  3. stephanM
    Member
    Posted 3 years ago #

    thanks for your help ! i will try it !

Topic Closed

This topic has been closed to new replies.

About this Topic