Okay
  Print

How do I change options on custom page templates and custom post types?

To change the options on custom page templates and custom post types in your child theme's functions.php file add:

function ghostpool_custom_init_variables() {
    // Custom page template
    if ( is_page_template( 'custom-template.php' ) ) {
        $GLOBALS['ghostpool_title'] = 'gp-large-page-header';
        $GLOBALS['ghostpool_layout'] =  'gp-no-sidebar';
        $GLOBALS['ghostpool_sidebar'] = 'gp-standard-sidebar';
    }
    // Custom post type
    if ( is_singular( 'custom_post_type' ) ) {
        $GLOBALS['ghostpool_title'] = 'gp-large-page-header';
        $GLOBALS['ghostpool_layout'] =  'gp-no-sidebar';
        $GLOBALS['ghostpool_sidebar'] = 'gp-standard-sidebar';
    }
    // Attachment page
    if ( is_attachment() ) {
        $GLOBALS['ghostpool_title'] = 'gp-large-page-header';
        $GLOBALS['ghostpool_layout'] =  'gp-no-sidebar';
        $GLOBALS['ghostpool_sidebar'] = 'gp-standard-sidebar';
    }
}
  • Replace "gp-large-page-header" with one of the following values depending on what theme you're using. Gauge: gp-large-title, go-no-large-title,  The Review: gp-standard-title, gp-large-title, gp-fullwidth-title, gp-full-page-title, gp-no-title  Socialize: gp-standard-page-header, gp-large-page-header, gp-fullwidth-page-header, gp-full-page-page-header
  • Replace "gp-no-sidebar" with one of the following values depending on what theme you're using. Gauge: gp-left-sidebar, gp-right-sidebar, gp-no-sidebar, gp-fullwidth The Review: gp-left-sidebar, gp-right-sidebar, gp-no-sidebar, gp-fullwidth  Socialize: gp-left-sidebar, gp-right-sidebar, gp-both-sidebars, gp-no-sidebar, gp-fullwidth
  • Replace "gp-standard-sidebar" with the ID of the sidebar you want to display.

Some of the option names may vary from theme to theme. You can view all the available options and the correct names in lib/inc/init-variables.php.