Is it possible to assign a new sidebar to the left side of a page? I created a new side bar “Paul Risser Memorial Library” and would like to implement it on the left side on this page:
Hello @wghiacy,
Thanks for asking. 
Yes, you can have sidebar on the left side of page. To do that open the page in by clicking on edit button and under Page Attributes > Templates and select Layout - Sidebar Left, Content Right.
To help you get started I have recorded a screencast that you can take a look.
Thanks.
Thank you for the reply.
I understand how to change the template via the page attributes. Thanks again for the screencast. But is there a way to assign a specific sidebar to this page? I do not want the same sidebar used on posts. 
Hi There,
Thanks for asking again!
You can do that via sidebar option. You can create one sidebar and assign to the page you want.
Go to Appearance -> Sidebars then create a sidebar and choose the page you want to show.

Hope this helps!
Thanks again for the quick reply! I deeply appreciate it. 
Unfortunately, the response does not help. The pages that contain the library (packages) are not listed. And so I can not apply the sidebar to be activated on the page. I understand from the plugin developer, that it generates the page using the single.php template ( single post template ) to show package details.
You see, I am using a plugin called WP Download Manager to create a library of our materials. Each material has a page. For example:
And so, on each of these pages, I would like to have a specific sidebar added to the left-side.
How do I add a specific sidebar to the packages WP Download Manager creates?
Hello There,
Thanks for writing in!
To resolve your issue, assuming that the child theme is set up, please add the following code in your child theme’s functions.php file
// assign sidebar to WPDM posts
// =============================================================================
add_filter( 'ups_sidebar', 'add_wpdm_sidebar' );
function add_wpdm_sidebar($sidebar){
if( is_single( 'wpdmpro' ) ){
return 'ups-sidebar-paul-risser-memorial-library';
}
return $sidebar;
}
// =============================================================================
We would loved to know if this has work for you. Thank you.
Thanks…
I added the code to the child theme’s functions.php file and it did not add the Paul Risser Memorial Library Sidebar to the WPDM packages. Also, I would like the Paul Risser Memorial Library Sidebar positioned on the left side of the package.
Here is a link that shows package (page) using the Main Sidebar (on right side)
Thank you for your help! I appreciate it greatly.
Hi There,
Please change the previous code to this:
add_filter( 'ups_sidebar', 'add_wpdm_sidebar' );
function add_wpdm_sidebar($sidebar){
if( is_singular( 'wpdmpro' ) ){
return 'ups-sidebar-paul-risser-memorial-library';
}
return $sidebar;
}
To achieve this, please also add this custom code under functions.php file:
function x_get_content_layout() {
$content_layout = x_get_option( 'x_layout_content' );
if ( $content_layout != 'full-width' ) {
if ( is_home() ) {
$opt = x_get_option( 'x_blog_layout' );
$layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
} elseif ( is_singular( 'post' ) ) {
$meta = get_post_meta( get_the_ID(), '_x_post_layout', true );
$layout = ( $meta == 'on' ) ? 'full-width' : $content_layout;
} elseif ( x_is_portfolio_item() ) {
$layout = 'full-width';
} elseif ( x_is_portfolio() ) {
$meta = get_post_meta( get_the_ID(), '_x_portfolio_layout', true );
$layout = ( $meta == 'sidebar' ) ? $content_layout : $meta;
} elseif ( is_page_template( 'template-layout-content-sidebar.php' ) ) {
$layout = 'content-sidebar';
} elseif ( is_page_template( 'template-layout-sidebar-content.php' ) ) {
$layout = 'sidebar-content';
} elseif ( is_page_template( 'template-layout-full-width.php' ) ) {
$layout = 'full-width';
} elseif ( is_archive() ) {
if ( x_is_shop() || x_is_product_category() || x_is_product_tag() ) {
$opt = x_get_option( 'x_woocommerce_shop_layout_content' );
$layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
} else {
$opt = x_get_option( 'x_archive_layout' );
$layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
}
} elseif ( x_is_product() ) {
$layout = 'full-width';
} elseif ( x_is_bbpress() ) {
$opt = x_get_option( 'x_bbpress_layout_content' );
$layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
} elseif ( x_is_buddypress() ) {
$opt = x_get_option( 'x_buddypress_layout_content' );
$layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
} elseif ( is_404() ) {
$layout = 'full-width';
} else {
$layout = $content_layout;
}
} else {
$layout = $content_layout;
}
if ( is_singular( 'wpdmpro' ) ) {
$layout = 'sidebar-content';
}
return $layout;
}
Hope that helps and thank you for understanding.
Thank you for your help! Everything is working as expected.
Glad we’re able to help 
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.