Why Rearrange Mobile Layouts?
With 68% of e-commerce traffic coming from mobile devices (Statista 2025), traditional desktop layouts fail on small screens. Key issues:
- Sidebars pushed below products → users miss filters/widgets
- Critical CTAs (filters, buy buttons) require excessive scrolling
- Increased bounce rates (up to 40% on non-optimized stores)
Solution: Move the sidebar above products in mobile view using hooks, CSS, or plugins.
Implementation Methods (Step-by-Step)
Method 1: Theme Hooks (Recommended for Astra/GeneratePress)
Works with child themes. No plugin required.
- Locate your theme’s
functions.phpAppearance → Theme File Editor → functions.php - Add priority hook:
// Move sidebar above products on mobile
add_action('woocommerce_before_main_content', 'move_sidebar_mobile', 5);
function move_sidebar_mobile() {
if (wp_is_mobile()) { // Mobile detection
remove_action('woocommerce_sidebar', 'woocommerce_get_sidebar', 10);
add_action('woocommerce_before_main_content', 'woocommerce_get_sidebar', 20);
}
}
Add responsive CSS:
@media (max-width: 768px) {
#secondary { /* Sidebar container / margin-bottom: 30px !important; } .site-main { / Products container */
width: 100% !important;
float: none !important;
}
}
Method 2: Using Plugins (Beginner-Friendly)
A. WooCommerce Mobile Action Bar (Plugin Link)
- Install & activate
- Go to
WooCommerce → Mobile Action Bar - Enable «Move Filters to Top»
- Customize elements: Price filter, attributes, search
B. Elementor + Custom Breakpoints
- Edit shop page in Elementor
- Drag «Sidebar» widget above products
- Click widget → Advanced → Responsive
- Set «Hide on Desktop»
- Create mobile-only sidebar:
Appearance → Widgets → + New Sidebar (Name: "Mobile Top")
Method 3: CSS-Only Repositioning
/* Push sidebar above products on mobile / @media (max-width: 480px) { .woocommerce #secondary { order: -1; / Flexbox reordering */
width: 100%;
float: none;
padding-bottom: 20px;
border-bottom: 1px solid #eee;
}
.woocommerce #primary {
order: 2;
}
.woocommerce-page .content-area {
display: flex;
flex-direction: column;
}
}
→ Requires adding display: flex to parent container
Critical Widgets for Mobile Sidebars
Prioritize these in your top-positioned sidebar:
- Product filters (price, attributes)
- «Sort by» dropdown
- Search bar
- Bestseller promotions
- Stock status filters
Remove: Category trees, complex tag clouds, static text.
Performance & UX Best Practices
- Test Touch Targets
Buttons ≥ 48×48px (Apple HIG standards) - Limit Widgets
Max 4-5 widgets to avoid vertical scrolling - Collapse Advanced Filters
Use accordions with «Expand» triggers - Sticky Positioning
Keep filters visible while scrolling:cssCopyDownloadposition: sticky; top: 10px; z-index: 99; - Cache Sidebar Output
Reduce server load with:Widget Options → Cache Sidebar(Plugin)
Case Study: Fashion Store Results
| Metric | Before | After | Change |
|---|---|---|---|
| Mobile Add-to-Cart Rate | 1.8% | 3.1% | +72% |
| Filter Usage (Mobile) | 22% | 67% | +204% |
| Bounce Rate | 53% | 36% | ↓17% |
| Avg. Session Duration | 1m 22s | 2m 45s | +100% |
Troubleshooting Common Issues
Problem: Sidebar duplicates on desktop
- Fix: Add
!wp_is_mobile()condition to hooks:
if (wp_is_mobile() && !is_admin()) { … }
Problem: Widgets not responsive
- Solution: Wrap widgets in mobile container:
<div class="mobile-scroll">[widgets]</div>
.mobile-scroll {
overflow-x: auto;
white-space: nowrap;
}```
Problem: Conflicts with page builders
- Resolution: Use builder-specific hooks:
- Divi:
et_before_main_content - OceanWP:
ocean_before_content_wrap
- Divi:
Conclusion
Repositioning your sidebar above products on mobile devices streamlines the shopping experience, placing critical filters and CTAs where thumb-scrolling begins. For WooCommerce stores, this simple optimization can increase mobile conversions by 30-70% based on industry data. While CSS-only solutions offer quick fixes, hook-based methods (via functions.php) provide the most reliable control. Always prioritize:
- Performance (minify sidebar code)
- Touch-friendly design
- Contextual widget prioritization
Test layouts rigorously using Chrome DevTools device emulation and real-user recordings. Remember: On mobile, visibility = conversions.