Theme options no longer showing up for editing
-
Hi folks,
I am hoping to help someone fix their WordPress site, and they are using a custom theme that was built for them some time ago. Likely their theme options are no longer working because upgrades have changed the way theme options work!
The problem:
– There were a number of theme options created, but I cannot see any fields to edit these options
– The existing data is no longer correct, but is still being used in the theme header etc.
– How can I get the custom theme options to once again be visible for editing via the Dashboard?I dug into the template files to see how this had been built, and here’s what I found:
– In theme-options.php the fields are defined. Here’s an example of two fields:
<div class="postbox"> <h3><?php _e("Link Settings", 'customthemename'); ?></h3> <div class="inside"> <p><?php _e("Insert the Newsletter page link", 'customthemename'); ?>:<br/><input type="text" name="<?php echo $settings;?>[newsletter_link]" value="<?php echo ot_option('newsletter_link'); ?>" size="30"/></p> <p><?php _e("Insert the link for the Donate Now button", 'customthemename'); ?>:<br/><input type="text" name="<?php echo $settings;?>[donate_link]" value="<?php echo ot_option('donate_link'); ?>" size="30"/></p> </div> </div>
– In template.php, there is this code:
// Pull theme options from database function ot_option($key) { global $settings; $option = get_option($settings); if(isset($option[$key])) return $option[$key]; else return FALSE; } // include the theme options include(TEMPLATEPATH."/includes/theme-options.php");
– And, in the header.php, here’s an example of what’s displaying to visitors (note this is displaying the old info just fine):
<div id="donatenow"> <a href="<?php echo ot_option('donate_link'); ?>" title="Donate Now"><img src="<?php bloginfo('template_url'); ?>/images/bt.donate.png" /></a> </div>
Can anyone help point me in the right direction? I am confused by how different this theme-option file is compared to the examples I have found while searching for an answer. Is there a simple solution?
Thanks for your time!
- The topic ‘Theme options no longer showing up for editing’ is closed to new replies.