Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Section: Content CPT
- Author: Simon Prosser
- Description: Load a CPT single template if available.
- Version: 1.0.0
- */
- class PageLinesContentCPT extends PageLinesSection {
- function __construct( $registered_settings = array() ) {
- $name = __('Content Area (CPT ENABLED)', 'pagelines');
- $id = 'maincontent';
- $settings = array(
- 'description' => 'This is the section that contains the main content for your site, including sidebars and page/post content.',
- 'workswith' => array('templates'),
- 'failswith' => array('404'),
- 'icon' => PL_ADMIN_ICONS . '/document.png'
- );
- parent::__construct($name, $id, $settings);
- }
- function section_template() {
- if ( file_exists( trailingslashit( STYLESHEETPATH ) . 'template.single-' . get_post_type() . '.php' ) )
- get_template_part( 'template.single-' . get_post_type() );
- else
- get_template_part( 'template.content' );
- }
- }
- /*
- End of section class
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement