This is more of a PHP question than a WordPress question, but I am using it in a WP theme.
In my options I am allowing users to show/hide breadcrumbs. However, when there are no preferences yet selected and saved (for example, if somebody were to install the theme) the breadcrumbs aren't displayed by default... and I would like them to be.
Below is my code. I'm confident I'm just missing a very small piece of code here...
Here is the array I am using:
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"),
Here is how I am calling the breadcrumbs in my posts:
<?php
if ( get_option('to_breadcrumbs') == 'Yes' ) {
if (function_exists('dimox_breadcrumbs')) dimox_breadcrumbs();
} ?>
This should probably work
Try using a default value:
If that doesn't work, try putting this in and see what it prints: