Double sidebar template

Is there a way to create a PAGE TEMPLATE, so that i can use one sidebar widget in PC+laptop, and another in tablet and mobile?

Im trying to create a template and with responsive hide or show the sidebar, that works, but i want to know how to put page content inside it?

Comments

  • how to put dinamic builder content, inside the 2/3 wrap? im figuring i cant, and i have to do a custom page.php and place it in child theme.


  • Hi,

    By 'Page template,' do you mean a dynamic template, such as one for a post or a portfolio? If so, there is no such feature. If you mean the content that you can populate a page with, that is not dynamic, see the following article:

    https://support.muffingroup.com/how-to/how-to-use-templates/

    What dynamic content do you want put there exactly?

    Something like a global wrap?

    https://support.muffingroup.com/video-tutorials/global-sections-wraps/


    Best regards

  • yes, like portfolio... Much more like a product template. You have woocommerce content, and you can add sidebar widget in one section and target big or small screens duplicating the section changin responsive. Ok, so I have to made my custom one or create a false ecommerce.

  • Ok, ive tried to paste php code but the web blocked me : )

    ive added a sidebar.php to mi child, and with some css and some php you are not going to see because the block,


    // Desktop Sidebar (>1280px)

    if( isset( $sidebar['sidebar']['first'] ) ){

    echo '<div class="mcb-sidebar sidebar sidebar-1 desktop-sidebar four columns '. esc_attr( $class ) .'" role="complementary" aria-label="Desktop sidebar">';

    echo '<div class="widget-area">';

    echo '<div class="inner-wrapper-sticky clearfix">';

    dynamic_sidebar( $sidebar['sidebar']['first'] );

    echo '</div>';

    echo '</div>';

    echo '</div>';

    }


    // Mobile/Tablet Sidebar (<1280px)

    echo '<div class="mcb-sidebar sidebar mobile-tablet-sidebar four columns '. esc_attr( $class ) .'" role="complementary" aria-label="Mobile/Tablet sidebar">';

    echo '<div class="widget-area">';

    echo '<div class="inner-wrapper-sticky clearfix">';

    dynamic_sidebar('mobile-tablet-sidebar'); // Nueva área de widgets

    echo '</div>';

    echo '</div>';

    echo '</div>';


    // Estilos para controlar la visibilidad

    echo '<style>

    @media (max-width: 1279px) {

    .desktop-sidebar {

    display: none !important;

    }

    .mobile-tablet-sidebar {

    display: block !important;

    }

    }

    @media (min-width: 1280px) {

    .desktop-sidebar {

    display: block !important;

    }

    .mobile-tablet-sidebar {

    display: none !important;

    }

    }

    </style>';

    i think ive made it

  • I am glad to see that you handled it.

    Please let me know if there's anything else I can help with.


    Best regards

  • yeah, but you know, i dont like do this things very often, they need maintenance.

Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.