Wordpress+PHP:将选项值放入变量
我相信这对你们来说一定很容易,但我很难将我的主题选项值放入其中一个变量中Wordpress+PHP:将选项值放入变量,php,wordpress,variables,Php,Wordpress,Variables,我相信这对你们来说一定很容易,但我很难将我的主题选项值放入其中一个变量中 $rate_size="echo get_option('mp_star_size')", 在下面的代码中,我必须使用该值,并且我允许用户从wordpress主题选项面板插入该值。我不知道如何设置它,以便在这个变量中获得主题选项值 $rate_size="echo get_option('mp_star_size')", 我试过了 $rate_size="'.echo get_option('mp_star_size'
$rate_size="echo get_option('mp_star_size')",
在下面的代码中,我必须使用该值,并且我允许用户从wordpress主题选项面板插入该值。我不知道如何设置它,以便在这个变量中获得主题选项值
$rate_size="echo get_option('mp_star_size')",
我试过了
$rate_size="'.echo get_option('mp_star_size').'",
但是它给了我语法错误,所以我不知道应该使用什么语法
好的,这是我想要得到的更多细节
以下代码:
wp_gdsr_render_article(
$stars_set="",
$stars_size=0,
$stars_set_ie6="",
$echo=true
);
我想允许我的主题用户从wordpress主题的主题选项面板中选择选项。所以我想用echo get_选项设置类似的东西,这样我就可以从选项面板中得到这个代码的每个参数的值
例如:
wp_gdsr_render_article(
$stars_set="here is my theme option",
$stars_size=here is my theme option,
$stars_set_ie6="here is my theme option",
$echo=here is my theme option
);
echo仅用于在页面上显示内容。quote呢?因为它需要包装值…它不能输出到页面不,它不是。quotes分隔字符串,get_选项返回一个字符串,这样就可以了。把你用过的代码和你得到的错误都贴出来。错误是我的错。这是我的主题选项array name=>Star Size,desc=>Select Size for Star ratings.,id=>$shortname.\u Star\u Size,type=>Select,options=>array12=>12,16=>16,20=>20,24=>24,30=>30,46=>46,std=>12,前缀是mp,我正在尝试连接我发布的代码这是我正在处理的函数文章\ U ratings$类{echo;wp_gdsr_render_article$template_id=0,$read_only=false,$stars_size=0,$stars_set_ie6=,$echo=true;wp_gdsr_render_article_thumbs$template_id=0,$read_only=false,$stars_set=,$stars_size=0,$stars_set_ie6=,$echo=true;echo;}在很多情况下都很酷,让我与所有人联系,然后再与您联系..: