• Hello everybody. I would like include this query post in my wordpress:

    <?php
    if ( is_home() ) {
    query_posts( ‘cat=-1,-3,-4,-5,-6,-7,-8’ );
    }
    ?>

    also with this string: posts_per_page=3

    How can I do?

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • <?php
    if ( is_home()) {
    query_posts( array (
         'posts_per_page' => 3,
         'cat' => '-1,-3,-4,-5,-6,-7,-8',
         'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1 ),
    ))
    }

    that last ‘paged’ line is necessary if you need pagination

    Thread Starter americo83

    (@americo83)

    Thanks Voodoo, but your code gives me an Internal Server Error 500. Why?

    I added ?> at the end of your code.

    Thread Starter americo83

    (@americo83)

    Ah it’s ok. Missing “;” at the end 🙂

    Thanks Voodoo

    Oh yeah, sorry about that, I copied/pasted from my theme and missed the tail end of it

    Thread Starter americo83

    (@americo83)

    No problem, thanks 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to combine this query_post’ is closed to new replies.