WordPress.org

Ready to get started?Download WordPress

Forums

OptionTree
[resolved] Using OptionTree to query category (2 posts)

  1. roygbiv
    Member
    Posted 3 years ago #

    I'm a newbie to PHP, and I'd like to use OptionTree's "Category" checkbox to select a category and then query that category in my template file. I can't figure out how to echo the category ID into a PHP call. If anyone could point me in the right direction, I'd greatly appreciate it!

  2. roygbiv
    Member
    Posted 3 years ago #

    Resolved (I think)... here's a snippet that's working, in case anyone else is looking for the same thing:

    $cat = get_option_tree( 'test_option', '', false, true, 0 );
    query_posts("cat=$cat&showposts=3");

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic