[英]Using SMOF in Wordpress Theme
我想給一個條件,選擇一個類別以顯示主題中特定類別的帖子。 使用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);`
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.