Hi Johnny,
Are you familiar with writing and editing PHP? I can point you in the right direction to edit this code, but I’m afraid there isn’t currently an option in Mission News for changing the layouts of custom post types.
Thread Starter
Johnny
(@johnny18sg)
Yes, I am familiar with php. Please direct me.
Thank you.
Okay great!
The first step is to activate a child theme. You can download a starter child theme for Mission News here: https://www.competethemes.com/help/child-theme-mission-news/
Then add this function into the functions.php file:
function mission_news_cpt_layout_class( $classes ) {
if ( is_singular( 'word' ) ) {
$classes[] = 'layout-no-sidebar';
}
return $classes;
}
add_filter( 'body_class', 'mission_news_cpt_layout_class' );
You might have to rename “word” to the exact string you named your CPT with. That function is going to apply the no sidebar styles to the CPT pages.
Next, copy both the sidebar-left.php and sidebar-right.php files into the child theme. Then add this to the top of both files:
if ( is_singular( 'word' ) ) {
return;
}
That will prevent the sidebars from being output on the CPT pages. Again, the string “word” might need to be adjusted here.
Thread Starter
Johnny
(@johnny18sg)
Works perfectly!
Thank you much for taking time to help me 🙂
You’re welcome! Glad I could help.