Created
May 2, 2018 05:47
-
-
Save rushijagani/6cd470405d6011d46113d0aff4111329 to your computer and use it in GitHub Desktop.
Custom Post Type Container, Sidebar Layout same as Blog Post Single.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'astra_get_content_layout', 'custom_post_type_content_layout'); | |
// Update the container layout for Custom Post Type same as Blog Post. | |
function custom_post_type_content_layout ( $layout ){ | |
$single_post = astra_get_option( 'single-post-content-layout' ); | |
// Add your CPT instead of newspaper, book. If it's only for one CPT then add just one CPT. | |
if ( is_singular( array( 'newspaper, book') ) ) { | |
$layout = $single_post; | |
} | |
return $layout; | |
} | |
add_filter( 'astra_page_layout', 'custom_post_type_page_layout'); | |
// Update the Sidebar layout for Custom Post Type same as Blog Post. | |
function custom_post_type_page_layout ( $layout ){ | |
$single_post = astra_get_option( 'single-post-sidebar-layout' ); | |
// Add your CPT instead of newspaper, book. If it's only for one CPT then add just one CPT. | |
if ( is_singular( array( 'newspaper, book') ) ) { | |
$layout = $single_post; | |
} | |
return $layout; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment