Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey @sannny,

    Hope you’re well.

    The plugin changed a lot until that thread time. So same solution can’t work for the latest version of Custom Sidebars. But sidebar assigned for the actual sidebar. If you create a page template for parent page and set new sidebar area from theme files for parent page then it will not change for child pages. You can check this tutorial for creating custom template https://premium.wpmudev.org/blog/creating-custom-page-templates-in-wordpress/

    Cheers,
    Oguz

    Thread Starter Sany

    (@sannny)

    Thanks for your advice. I created a page template with a custom theme widget for this (register_sidebar($args)). Now everything looks like it should. Fortunately there are one some pages that are affected.

    Thank you very much and have a nice day
    saNNNy

    You can also check for the correct sidebars on the page:

    
    // Get only this page's sidebars.
    global $post;
    $meta = get_post_meta($post->ID, '_cs_replacements', true );
    $active_sidebars = array_keys($meta);
    
    // Only show correct sidebars.
    if (is_active_sidebar( 'my-sidebar' ) && in_array('my-sidebar', $active_sidebars) ) {
      dynamic_sidebar( 'my-sidebar' );
    }
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove inheritance’ is closed to new replies.