2016-03-01 47 views
0

林新與終極版框架和Im去除propanel和Im加入終極版代替,但選擇現在不工作如何顯示在主題終極版框架選項

舉例來說,在我的主題爲相關視頻的exsisting選項:

<?php 
$relatedvideosbase = get_option('mytheme_relatedvideos'); 
if ($relatedvideosbase == "tags") { 
get_template_part('related/tags', get_post_format()); 
} elseif ($relatedvideosbase == "category") { 
get_template_part('related/category', get_post_format()); 
} elseif ($relatedvideosbase == "random") { 
get_template_part('related/random', get_post_format()); 
} else { 
get_template_part('related/tags', get_post_format()); 
} 
?> 

上面的代碼是工作的罰款與propanel和我刪除propanel現在又增加了Redux框架和創建這樣的選項:

array(
     'id'  => '_relatedvideos', 
     'type'  => 'button_set', 
     'title' => __('Related Videos by?', 'redux-framework-demo'), 
     //Must provide key => value pairs for radio options 
     'options' => array(
      'tags' => __('Tags','redux-framework-demo'), 
      'category' => __('Category','redux-framework-demo'), 
      'random' => __('Random','redux-framework-demo') 
     ), 
     'default' => 'random' 
    ), 

也改變了opt name,因爲我在propanel $opt_name = 'mytheme';中有過,但是使用redux框架我無法弄清楚,有什麼辦法嗎?感謝..

回答

1

你需要你的代碼之前

echo $redux_demo['the option id']; 

變化$ redux_demo添加全局$ redux_demo像下面

global $redux_demo; // This is your opt_name. 

和呼應選項將選項名稱和更改選項ID爲您的選項ID

https://docs.reduxframework.com/core/getting-started/