0
这是一个比WordPress问题更多的PHP问题,但我在WP主题中使用它。PHP默认显示(调用或数组?)
在我的选项中,我允许用户显示/隐藏面包屑。但是,当没有选择并保存偏好时(例如,如果有人安装主题),面包屑默认情况下不会显示...我希望它们是。
以下是我的代码。我相信我只是缺少一个非常小的一块在这里代码...
这里是我使用的阵列:
array("name" => "Display breadcrumbs on post pages?",
"desc" => "Choose whether or not to display breadcrumbs, that is, the post trail.",
"id" => $shortname."_breadcrumbs",
"type" => "select",
"options" => array("Yes", "No"),
"std" => "Yes"),
这里是我如何打电话在我的职位面包屑:
<?php
if (get_option('to_breadcrumbs') == 'Yes') {
if (function_exists('dimox_breadcrumbs')) dimox_breadcrumbs();
} ?>
这是行不通的。 :-(当用户选择没有面包屑现在仍然显示 – siouxfan45
为什么当它不起作用时将它标记为接受的答案?)你是如何尝试它的? – str