WordPress.org

Support

Support » Plugins and Hacks » Hacks » [Resolved] Adding array within the $my_query info

[Resolved] Adding array within the $my_query info

  • I have set up in my admin to type in the number of posts to show and the category id (as my fiance is no good with code and it is her site).

    This is what I have right now:
    <?php $my_query = new WP_Query('showposts=2&cat=13'); ?>

    However, for the showposts, I have the following array to use instead of 2:

    <?php $section1_categoryid = get_option('section1_categoryid'); echo $section1_categoryid; ?>;

    And for the cat ID, I have the following array instead of 13:

    <?php $section1_numberofposts = get_option('section1_numberofposts'); echo $section1_numberofposts; ?>;

    The code works fine on its own, but how would I include it in the above $my_query code?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Adding array within the $my_query info’ is closed to new replies.
Skip to toolbar