Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End WordPress Theme Option Problem

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #40315
    tahirk
    Participant

    Hi,

    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’ )); ?>

    #111957
    chrisburton
    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’ )); ?>`

    #111958
    tahirk
    Participant

    Thanks Christopher. On line 88 I have this:

    #111959
    chrisburton
    Participant

    @tahirk Hmm. Try my suggestion above. If that doesn’t work, keep the change but also try this:

    `

    #111960
    tahirk
    Participant

    Thanks 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.

    #111961
    tahirk
    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');
    ?>





















    get_theme_mod('featured_top_left'), 'name' => $settings, 'orderby' => 'Name' , 'hierarchical' => 1, 'hide_empty' => '0' )); ?>









    x










    get_theme_mod('blog_cat'), 'name' => $settings.'[blog_cat]', 'orderby' => 'Name' , 'hierarchical' => 1, 'show_option_all' => __("All Categories", 'studiopress'), 'hide_empty' => '0' )); ?>






















    // add CSS and JS if necessary
    function theme_options_css_js() {
    echo <<


    CSS;
    echo <<


    JS;
    }
    ?>

    #111962
    chrisburton
    Participant

    May 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: “

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Back End’ is closed to new topics and replies.