new wp_query(parameters not passed) (4 posts)

  1. jonton26
    Posted 10 years ago #

    hi everyone
    im working on customizing wordpress 1.5.2

    i have a few queries to make on the homepage where i basically request a list of 5 recent posts put together by category. Now when i write the query i request the category and the length of the list by passing
    $my_query = new WP_Query('category_id=21&showposts=5');

    but the system always returns the latest 5 from any given category...not the category i want...21 in this example.

    url is http://www.spoode.com/wordpress/
    check it out

    thx for any help

  2. joksanen
    Posted 9 years ago #

    I believe
    $my_query = new WP_Query('category_id=21&showposts=5');

    should be
    $my_query = new WP_Query('cat=21&showposts=5');

    At least it worked for me.

    Do you happen to have difficulties making these second queries with IE or Opera? I have and they work just fine with Firefox. Hopefully it's again something really stupid reason I'm embarrassed to admit.

  3. moshu
    Posted 9 years ago #

    It is quite useless to "reply" to a post more than one year old... Look at the date!

  4. joksanen
    Posted 9 years ago #

    I have to admit I didn't notice the date. But, someone might still end up on the post with the search and would like to have an answer. I found it with search trying to find an answer for my problem. Not helping me, but maybe someone else.

    Why should there be a limit how old a thread to reply to? Unless, there really is a rule of it. In which case I apologize.

Topic Closed

This topic has been closed to new replies.

About this Topic