Theme options: Display ID of page options
Theme options: Display ID of page options
Theme options: Display ID of page options
$wp_customize->add_setting(‘theme_options[copyright]’, array( ‘default’ => ‘1’, ‘capability’ => ‘edit_theme_options’, ‘type’ => ‘option’, )); There is nothing wrong except the default value (missing). You cant use your setting till you store it a value.
You’re forcing of_get_option to return a value in all cases, by setting the 2nd argument, which is the default value to return in the case the option doesn’t exist. If you want it to evaluate to false in the case where there is no value, remove the 2nd argument: if (of_get_option(‘page_background’)){
I am using shortcodes. But you need to work differently with this and make it easier for the client. On the theme options page you should have inputs with type=”checkbox” where the client chooses what share buttons to appear. In the template you should get the option with get_option(‘registered_option’) and display those buttons for which … Read more
I think you have to solve this with jQuery. If checked -> addClass, if not -> removeClass. Here’s how to enqueue your JS file: add_action(‘admin_menu’, ‘fwds_plugin_settings’); function fwds_plugin_settings() { $hook = add_menu_page( ‘Price Display’, ‘Price Display’, ‘add_users’, ‘fwds_settings’, ‘fwds_display_settings’ ); add_action( “admin_print_scripts-$hook”, ‘fwds_print_scripts’ ); } function fwds_print_scripts() { wp_register_script( ‘my-fx’ , plugin_dir_url( __FILE__ ) . … Read more
Your code should work (not how you expect but it should work), and probably the error was in something that you didn’t post. However… __FILE__ is a constant: you don’t have to use quotes when write it. Remove them like so: add_menu_page(‘Item Display’,’Item Display’,’administrator’, __FILE__, function(){ }); If you use the quotes, ‘__FILE__’ became a … Read more
In your “Blank Slate” starter theme: STEP I: Open the functions.php and find the word: “register_sidebar”. Inside the blankslate_widgets_init() function, paste the following codes just after the register_sidebar() ends, but inside the blankslate_widgets_init() function (before closing second braces – ‘}’): register_sidebar( array ( ‘name’ => __(‘Left Widget Area’, ‘blankslate’), ‘id’ => ‘secondary-widget-area’, ‘before_widget’ => ‘<li … Read more
Theme Options Doesn’t Work On WP Multisite
Try passing ‘my_theme_options’ directly to get_option() function instead of storing it in variable as following. $options = get_option(‘my_theme_options’); Instead of global $option_name; $options = get_option($option_name);
You have to add more than one setting. Change $wp_customize->add_setting( ‘img-upload’ ); to two unique settings. i.e. img-upload-1, img-upload-2. Then call the settings in your code.