- This topic is empty.
-
AuthorPosts
-
October 15, 2012 at 10:30 pm #40315
tahirk
ParticipantHi,
I’m having some problems with my theme-options.php & now I’m unable to edit any of appearance options nor the website opens .
My WordPress Site:
http://www.dryerventcleaninghouston.com/This is where the error occurs:
get_theme_mod(‘featured_top_left’), ‘name’ => $settings.'[featured_top_left]’, ‘orderby’ => ‘Name’ , ‘hierarchical’ => 1, ‘hide_empty’ => ‘0’ )); ?>
October 15, 2012 at 11:17 pm #111957chrisburton
Participant@Tahirk What is on line 88?
Shouldn’t it be
` get_theme_mod(‘featured_top_left’), ‘name’ => $settings, ‘orderby’ => ‘Name’ , ‘hierarchical’ => 1, ‘hide_empty’ => ‘0’ )); ?>`
October 15, 2012 at 11:35 pm #111958tahirk
Participantchrisburton
Participant@tahirk Hmm. Try my suggestion above. If that doesn’t work, keep the change but also try this:
`
October 16, 2012 at 12:06 am #111960tahirk
ParticipantThanks a lot for your help, I’m still facing some problems:
Basically at first I was having some problems with setting the number of posts to show as they would reset to 3 as soon as I set it to 5. So I tried to edit & it bite me back.
October 16, 2012 at 12:12 am #111961tahirk
Participant
/*
Plugin Name: Theme Options
Author: Nathan Rice
Author URI: http://www.nathanrice.net/
NOTE: this file requires WordPress 2.7+ to function
*/
$settings = 'mods_'.get_current_theme(); // do not change!
$defaults = array( // define our defaults
'header_blog_title' => 'Image',
'featured_top_left' => 1,
'featured_top_left_num' => 5,
'featured_top_left_thumb_width' => 100,
'featured_top_left_thumb_height' => 100,
'blog_cat' => 1,
'blog_cat_num' => 5 // <-- no comma after the last option
);
// push the defaults to the options database,
// if options don't yet exist there.
add_option($settings, $defaults, '', 'yes');
/*
///////////////////////////////////////////////
This section hooks the proper functions
to the proper actions in WordPress
\\\\\\\\\\\\\\\\\\\\\\\
*/
// this function registers our settings in the db
add_action('admin_init', 'register_theme_settings');
function register_theme_settings() {
global $settings;
register_setting($settings, $settings);
}
// this function adds the settings page to the Appearance tab
add_action('admin_menu', 'add_theme_options_menu');
function add_theme_options_menu() {
add_submenu_page('themes.php', 'Education '.__('Theme Options','studiopress'), 'Education '.__('Theme Options','studiopress'), 8, 'theme-options', 'theme_settings_admin');
}
/*
///////////////////////////////////////////////
This section handles all the admin page
output (forms, update notifications, etc.)
\\\\\\\\\\\\\\\\\\\\\\\
*/
function theme_settings_admin() { ?>
// display the proper notification if Saved/Reset
global $settings, $defaults;
if(get_theme_mod('reset')) {
echo '';'.__('Theme Options', 'studiopress').' '.__('RESET TO DEFAULTS', 'studiopress').'
update_option($settings, $defaults);
} elseif($_REQUEST == 'true') {
echo '';'.__('Theme Options', 'studiopress').' '.__('SAVED', 'studiopress').'
}
// display icon next to page title
screen_icon('options-general');
?>
// add CSS and JS if necessary
function theme_options_css_js() {
echo <<
CSS;
echo <<
JS;
}
?>
October 16, 2012 at 12:27 am #111962chrisburton
ParticipantMay I ask why you’re editing a plugin file? This is usually not recommended. Plus, `'[]’` seems to happen a lot in that code. From the very little knowledge I have with PHP, I thought it was supposed to go like this: “
AuthorPostsViewing 7 posts - 1 through 7 (of 7 total)- The forum ‘Back End’ is closed to new topics and replies.