I am using the Options Framework.
In my theme's options.php
, I have the following code:
function optionsframework_options() {
$options = array();
$options[] = array(
'name' => __('Footer Navigation', 'options_framework_theme'),
'type' => 'heading');
$options[] = array(
'name' => __('Button 1 URL', 'options_framework_theme'),
'desc' => __('Enter the URL clicking on the button takes you to.', 'options_framework_theme'),
'id' => 'footer-nav1_URL',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('Button 1 Text', 'options_framework_theme'),
'desc' => __('Enter the text you see underneath the button.', 'options_framework_theme'),
'id' => 'footer-nav1_text',
'std' => '',
'type' => 'text');
In my theme's footer.php
, I have the following code:
<?php if (of_get_option('footer-nav1_URL', '') !== '') { ?>
<a href="<?php echo of_get_option('footer-nav1_URL', '');?>">
<span id="icon1" class="index2"></span>
<span class="iconshadow index1"></span>
<span class="name"><?php echo of_get_option('footer-nav1_text', '');?></span>
</a>
<?php
}?>
Those options are not being output in the footer. The footer is working normally otherwise.
Other options called in front-page.php
are working okay though.
Why won't these options work?
I am using the Options Framework.
In my theme's options.php
, I have the following code:
function optionsframework_options() {
$options = array();
$options[] = array(
'name' => __('Footer Navigation', 'options_framework_theme'),
'type' => 'heading');
$options[] = array(
'name' => __('Button 1 URL', 'options_framework_theme'),
'desc' => __('Enter the URL clicking on the button takes you to.', 'options_framework_theme'),
'id' => 'footer-nav1_URL',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('Button 1 Text', 'options_framework_theme'),
'desc' => __('Enter the text you see underneath the button.', 'options_framework_theme'),
'id' => 'footer-nav1_text',
'std' => '',
'type' => 'text');
In my theme's footer.php
, I have the following code:
<?php if (of_get_option('footer-nav1_URL', '') !== '') { ?>
<a href="<?php echo of_get_option('footer-nav1_URL', '');?>">
<span id="icon1" class="index2"></span>
<span class="iconshadow index1"></span>
<span class="name"><?php echo of_get_option('footer-nav1_text', '');?></span>
</a>
<?php
}?>
Those options are not being output in the footer. The footer is working normally otherwise.
Other options called in front-page.php
are working okay though.
Why won't these options work?
Share Improve this question edited Oct 16, 2020 at 8:31 Lenin 1902 silver badges14 bronze badges asked Jan 4, 2014 at 6:09 SteveSteve 1,75719 gold badges66 silver badges115 bronze badges1 Answer
Reset to default 5 +50I think the problem is that you are using uppercase letters in the options id:
footer-nav1_URL
Try instead:
footer-nav1_url
In general you should avoid using uppercase letters in options names in WordPress.