Grow your CSS skills. Land your dream job.

query_posts help

  • # January 6, 2009 at 2:40 pm

    Hey there,

    I need some advice. I’m not sure if this the correct way I should be using query_posts but here goes.

    Whenever I submit a post under the category uevent it posts the title over in the sidebar. I did this by using <?php query_posts(‘cat=-4′); ?> in the main loop(i think it’s called) so it doesn’t get posted there at all. And I put this in my sidebar <?php query_posts(‘cat=4&showposts=5′); ?>

    So it lists the title of the 5 most recent posts filed in the uevent category.

    It works great, but I’ve tried to wrap a div around that query but it doesn’t work. When I check the source the div gets placed before the query.

    I try this:

    Code:
    < ?php query_posts('cat=4&showposts=5'); ?>

    This is the output:

    Code:
    [b]

    [/b]

    For me to add a div or a class do I need to feed it as an argument into that function?

    Hope you understand what I mean.

    TIA!

    # January 6, 2009 at 7:27 pm

    Problem is resolved now. It was just me being silly.

    I should of wrapped this instead:

    Code:
    # January 8, 2009 at 2:26 am

    well done, sometimes we find our own answers after asking questions, I used to do that in a java forum

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".