Forums

PHP in Querypost (2 posts)

  1. stevenoi
    Member
    Posted 2 years ago #

    Hi, I use get_option to get the settings for my querypost :
    <?php query_posts('cat=-'.get_option('excludecat')); ?>
    But now I also want to insert the showposts with get_option
    <?php query_posts('showposts='.get_option('p-post-show')); ?>
    And I can't get this into on single code...

    Steven

  2. stevenoi
    Member
    Posted 2 years ago #

    Found the solution :

    <?php
    $wp_query->query_vars["cat"] = get_option('excludecat');
    $wp_query->query_vars["showposts"] = get_option('p-post-show');
    $wp_query->get_posts();
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.