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.