I am currently using Options Framework Theme for making WordPress options panel. I created a checkbox in admin panel by this code in options.php
$options[] = array(
'name' => __('Input Checkbox Name', 'options_framework_theme'),
'desc' => __('Check to display.'),
'id' => 'example_checkbox_2',
'std' => 'true',
'type' => 'checkbox');
I want to display different content when the checkbox is checked or unchecked. So, I inserted this code in file template (footer.php
)
<?php if ( of_get_option('example_checkbox2') != 'true') { ?>
<p>checked</p>
<?php } else { ?>
<p>unchecked</p>
<?php } ?>
My problem is:
When I checked or uncheck the checkbox, "checked
" is displayed in my footer.
Could anybody help how to retrieve and display content from checkbox correctly?
Any respond are highly appreciated.
Thank you.