WordPress.org

Ready to get started?Download WordPress

Forums

Genesis Layout Extras
Global Custom Post Type Layout (2 posts)

  1. klipari
    Member
    Posted 10 months ago #

    I'd like to force my custom post type archive and single page to use the Content Sidebar-Alt layout always.

    Having it in the CPT post editor is kinda akward and the built in archive uses the normal Content-Sidebar layout.

    The site default is Content-sidebar-sidebar, so I can't change that either.

    Any advice on how to do this easily?

    Thanks!

    Kimberly

    http://wordpress.org/plugins/genesis-layout-extras/

  2. daveshine (David Decker)
    Member
    Plugin Author

    Posted 10 months ago #

    Hi Kimberly!

    Thanks for your feedback!

    If I understood you correctly, you could do that with my plugin, at least for the archive. For single posts of that post type see at the bottom of my answer.

    Enable the layout "Content Sidebar-Alt", also enable style sheet loading for it, via the setting "Load CSS styles for the two 2-column layouts?"

    Also enable global support for Archive Settings page. On that settings page for your post type, enable the layout "Content Sidebar-Alt".

    This should do it!

    However, if that is not working, it could also be some mysterious change/ bug in Genesis that we are currently testing out with core developers, related to the layout setting/ saving, especially default layouts. But please try the above first.

    For single entries of that post type, use the inpost layout settings (enable before via my plugin). If you want to enforce that by default you would need to add the following code to your functions.php of your child theme (make file backup before!):

    add_filter( 'genesis_pre_get_option_site_layout', 'gle_custom_cpt_single_layout', 101 );
    /**
     * Genesis Layout Extras: Custom Layout for a CPT single posts.
     */
    function gle_custom_cpt_single_layout( $opt ) {
    
    	if ( is_singular( 'your-post-type-here' ) ) {
    		$opt = 'content-sidebaralt';
    	}
    
    	return $opt;
    
    }

    'your-post-type-here' ---> this needs to be replaced with the registered ID of your post type.

    I hope that works for you.

    Thanks, Dave :)

Reply

You must log in to post.

About this Plugin

About this Topic