在Wordpress主题中使用SMOF

在Wordpress主题中使用SMOF,wordpress,Wordpress,我想给一个条件,选择一个类别,以显示我的主题从一个特定类别的文章。使用smof框架我无法做到这一点 query_posts('category_name=hot&showposts=1'); if ( have_posts() ) while ( have_posts() ) : the_post(); 是我的代码,以显示从类别热功能帖子;但我想给出一个条件,从主题选项中选择类别 下面是创建选择类别的smof代码 $of_options[] = array( "name"

我想给一个条件,选择一个类别,以显示我的主题从一个特定类别的文章。使用smof框架我无法做到这一点

query_posts('category_name=hot&showposts=1'); 
if ( have_posts() ) while ( have_posts() ) : the_post();
是我的代码,以显示从类别热功能帖子;但我想给出一个条件,从主题选项中选择类别

下面是创建选择类别的smof代码

$of_options[] = array(  "name"      => "Select a Category",
        "desc"      => "A list of all the categories being used on the site.",
        "id"        => "example_category",
        "std"       => "Select a category:",
        "type"      => "select",
        "options"   => $of_categories
                );
如何使用此功能?

这项工作

  $of_options[] = array( "name" => "Select a Category",
  "desc" => "A list of all the categories being used on the site.",
  "id" => "id_cat-name",
  "std" => "select category",
  "type" => "select",
  "options" => $of_categories);`

欢迎来到StackOverflow。此答案已标记为质量审查,因为它是我们所称的“仅代码”答案。它没有被删除,但我们想提醒您注意。谢谢你的帮助。