Community Forums › Forums › Archived Forums › General Discussion › Page Layouts Not Working for Custom Post Types (News Pro Theme)
Tagged: Custom Post Type, News Pro, page layouts
- This topic has 6 replies, 2 voices, and was last updated 7 years, 1 month ago by Victor Font.
-
AuthorPosts
-
February 6, 2017 at 2:25 pm #200668hossranMember
I have implemented custom post types on my site using the CPT UI plugin and I have Page Layout Meta when creating a new post but no matter which layout I select my posts default to the site wide default layout.
I have spent hours researching this and cannot really find a solution to the issue. It appears I shouldn't have to do anything based on my research on the issue but I did see some mention around adding a single."custom post".php
any help and guidance is appreciated.
February 7, 2017 at 7:54 am #200690Victor FontModeratorYou can create your own CPT tempate. The file name would be single-{post_type}.php where {post_type} is the CPT slug. This is the main code from single-portfolio.php. It will help you get started in the right direction:
//* Force full width content layout add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); //* Remove the breadcrumb navigation remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' ); //* Remove the post info function remove_action( 'genesis_entry_header', 'genesis_post_info', 5 ); //* Remove the author box on single posts remove_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 ); //* Remove the post meta function remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); genesis();
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 7, 2017 at 4:17 pm #200727hossranMemberThank you for that template! Is there anyway to get the built in page layouts to work with custom post types?
February 8, 2017 at 3:08 am #200752Victor FontModeratorActually, the layout meta box should automatically be there. If it's not appearing, the option to display it may not be checked in the editor page screen option at the top of the page.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 8, 2017 at 3:40 am #200758Victor FontModeratorDid you add the Genesis post type support for your CPT?
add_post_type_support( 'portfolio', array( 'genesis-seo', 'genesis-scripts', 'genesis-layouts', 'genesis-rel-author' ) );
Change portfolio to your post type.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 8, 2017 at 6:27 pm #200811hossranMemberI do have the meta box and all of the page layout options are available to me but no matter which one I select, my custom posts default to the site wide default of 'content-sidebar'.
February 9, 2017 at 4:25 am #200830Victor FontModeratorAre you using a custom page template to display the CPTs? At this point, I can't help you any further without taking a look at the site. If you post a link tot he site, maybe I can see something obvious, but it's probably going to provide a deeper level of troubleshooting than I can provide as a community volunteer.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet? -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.