Awesome, thanks @paul.r. Fantastic support as always. I do have one more question…
This is all working perfectly, I have my individual CPT posts showing the correct Sidebar using this:
// 10. Give Support Articles The Support Sidebar
// =============================================================================
// 10a. Assign Default Sidebar to Support Articles
add_filter('x_option_x_layout_content', 'sidebars_in_support_articles', 5);
function sidebars_in_support_articles($contents) {
if ( is_singular( 'support_article' ) ) {
$contents = 'content-sidebar';
}
return $contents;
}
// 10b. Override Default Sidebar with Alternative for Support Articles
add_filter( 'ups_sidebar', 'support_articles_sidebar' );
function support_articles_sidebar($sidebar){
if( is_singular( 'support_article' )){
return 'ups-sidebar-support-sidebar';
}
return $sidebar;
}
I’m also listing these CPT on a standard ‘page’ and I’d like to add the sidebar to just this page too.
So far I have done the below and the page is showing the area for the sidebar (the layout is adjusting to display the sidebar on the right), but the actual sidebar is not showing. Why is this? Any advice?
// 11. Give Support Centre Index The Support Sidebar Sidebar
// =============================================================================
// 11a. Assign Default Sidebar to Support Centre Index
add_filter('x_option_x_layout_content', 'sidebars_in_support_index', 5);
function sidebars_in_support_index($contents) {
if ( is_page ( 'support-centre' ) ) {
$contents = 'content-sidebar';
}
return $contents;
}
// 11b. Override Default Sidebar with Alternative for Support Centre Index
add_filter( 'ups_sidebar', 'support_index_sidebar', 5 ); //testing 5
function support_index_sidebar($sidebar){
if ( is_page ( 'support-centre' ) ) {
return 'ups-sidebar-support-sidebar';
}
return $sidebar;
}
Any help would be greatly appreciated as I’m at the final hurdle I reckon!!