This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Changing Options on the Styles Menu

  • Creator
    Topic
  • #1095
    spyke01
    Participant

    I am trying to change the “Body Style” option and possibly a few others but for some reason my code isn’t working. I was successfully able to add other tabs just not edit this one.

    Here’s my test code:

    themeblvd_edit_option( 'styles', 'main_styles', 'body_style', 'options', array(
    		'light' 		=> __( 'Light', TB_GETTEXT_DOMAIN ),
    		'dark' 			=> __( 'Dark', TB_GETTEXT_DOMAIN ),
    		'grey' 			=> __( 'Grey', TB_GETTEXT_DOMAIN )
    	)
    );

    Any ideas on why this isn’t working?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #1105
    Jason Bobich
    Keymaster

    Hello,

    The reason is because the current function alyeska_options that sets all of these options up in /includes/theme-functions.php, is hooked to after_setup_theme. So when you place your call to the themeblvd_edit_option in your Child theme’s functions.php, you’re not actually overriding anything because the body_style option hasn’t technically been created yet.

    In your Child theme’s functions.php after the framework is included, you need to wrap your overrides like this in a function that’s hooked in later in the WordPress loading process:

    function my_options(){
    	// themeblvd_edit_option ...
    }
    add_action( 'after_setup_theme', 'my_options' );
    #1110
    spyke01
    Participant

    Thanks, that worked perfectly. Also on a related note is there a option type which allows to upload an image for that field? The “logo” type is overkill for what I need.

    #1113
    Jason Bobich
    Keymaster

    Yup. There is an option type called “upload” — I’m just not using it anywhere, but it is there if you want to use it.

    #1115
    spyke01
    Participant

    Once again, exactly what I was looking for.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The forum ‘Alyeska Responsive WordPress Theme’ is closed to new topics and replies.