Black Friday Sale! Get up to $30 off GP Premium! Learn more ➝

[Resolved] derivative themes

Home Forums Support [Resolved] derivative themes

Home Forums Support derivative themes

  • This topic has 3 replies, 2 voices, and was last updated 5 years ago by Tom.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #242023
    Henry

    Your child themes (exhibit, mantle, freelancer, etc) are a great starting place for my customer sites.
    I would like to create derivatives that have some changes. You recommend using plugininception to create a plugin, that should work great, although you may have another recommendation!

    As a skilled PHP developer with minimal wordpress experience, I want to enhance the Exhibit theme. I want the default to be content only (no sidebar), I want to set the header background color, and I want to change the font weight for the body.

    I see that the functions.php file in the Exhibit theme has these lines
    $exhibit_font_defaults[ ‘body_font_weight’ ] = ‘300’;
    $exhibit_defaults[ ‘layout_setting’ ] = ‘right-sidebar’;
    $exhibit_color_defaults[ ‘header_background_color’ ] = ‘#222222’;

    I want to write a plugin or hook that will set these values
    [ ‘body_font_weight’ ] = ‘400’;
    [ ‘layout_setting’ ] = ‘content’;
    [ ‘header_background_color’ ] = ‘#232323’;

    My question 1 is: What is the syntax of the plugin or hook that will make this happen.

    Question 2: is there documentation for the allowable values of all the defaults? (e.g. what is allowed for ‘layout_setting’, post_content, back_to_top…)

    Thanks Tom, your’e the bomb!

    #242086
    Tom
    Lead Developer
    Lead Developer

    Hi Henry,

    Well, the easiest way is to just use the Customizer – they override those defaults.

    If you want to use functions, then the perfect examples are right there in the Exhibit theme.

    You would just copy the entire function, for example:

    if ( !function_exists( 'exhibit_defaults' ) ) :
    add_filter( 'generate_option_defaults','exhibit_defaults' );
    function exhibit_defaults( $exhibit_defaults )
    {
    	$exhibit_defaults[ 'hide_title' ] = '';
    	$exhibit_defaults[ 'hide_tagline' ] = '';
    	$exhibit_defaults[ 'logo' ] = '';
    	$exhibit_defaults[ 'container_width' ] = '1220';
    	$exhibit_defaults[ 'header_layout_setting' ] = 'fluid-header';
    	$exhibit_defaults[ 'center_header' ] = 'true';
    	$exhibit_defaults[ 'center_nav' ] = 'true';
    	$exhibit_defaults[ 'nav_alignment_setting' ] = 'center';
    	$exhibit_defaults[ 'header_alignment_setting' ] = 'center';
    	$exhibit_defaults[ 'nav_layout_setting' ] = 'fluid-nav';
    	$exhibit_defaults[ 'nav_position_setting' ] = 'nav-below-header';
    	$exhibit_defaults[ 'nav_search' ] = 'enable';
    	$exhibit_defaults[ 'nav_dropdown_type' ] = 'hover';
    	$exhibit_defaults[ 'content_layout_setting' ] = 'separate-containers';
    	$exhibit_defaults[ 'layout_setting' ] = 'right-sidebar';
    	$exhibit_defaults[ 'blog_layout_setting' ] = 'right-sidebar';
    	$exhibit_defaults[ 'single_layout_setting' ] = 'right-sidebar';
    	$exhibit_defaults[ 'post_content' ] = 'full';
    	$exhibit_defaults[ 'footer_layout_setting' ] = 'fluid-footer';
    	$exhibit_defaults[ 'footer_widget_setting' ] = '3';
    	$exhibit_defaults[ 'back_to_top' ] = '';
    	$exhibit_defaults[ 'background_color' ] = '#9e9e9e';
    	$exhibit_defaults[ 'text_color' ] = '#3a3a3a';
    	$exhibit_defaults[ 'link_color' ] = '#1e73be';
    	$exhibit_defaults[ 'link_color_hover' ] = '#222222';
    	$exhibit_defaults[ 'link_color_visited' ] = '';
    	
    	return $exhibit_defaults;
    }
    endif;

    But you would give it a different function name.

    There isn’t any documentation for that currently, you would have to look into the customizer.php and functions.php of those add-ons to see all of the options available to you.

    Hope this helps πŸ™‚

    #243422
    Henry

    perfect, thank you

    #243441
    Tom
    Lead Developer
    Lead Developer
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.