Misplaced sidebar widgets
-
Updated my theme and now the sidebar widgets are placed under the products.
I have woocommerce installed and I know this is causing the issues. Been looking around to find the problem but I cant find it so I need help.I created a child theme and placed this in functions.php:
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10); add_action('woocommerce_before_main_content', 'fashionistas_child_wrapper_start', 10); add_action('woocommerce_after_main_content', 'fashionistas_child_wrapper_end', 10); function fashionistas_child_wrapper_start() { echo '<section id="main">'; } function fashionistas_child_wrapper_end() { echo '</section>'; } /* Ärver style.css från huvudtemat */ add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); } /* Deklarerar stöd för WooCommerce */ add_action( 'after_setup_theme', 'woocommerce_support' ); function woocommerce_support() { add_theme_support( 'woocommerce' ); } ?>and this in style.css:
/* Theme Name: Fashionistas Child Theme URI: http://misselli.se/ Description: Fashionistas Child Theme Author: Habil Kantur Author URI: http://misselli.se Template: fashionistas Version: 1.0.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready Text Domain: fashionistas-child */URL is http://misselli.se
-
Hi
can you check with adding a priority to the action hook
Change it from
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );to
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', 99 );Nope, no change.
Any other ideas?Hi
I checked your site again, the issue is due to the change in structure you have made.
after
<div class="clearfix container">change the
<div id="container">to<div id="primary" class="content-area">and this will fix the issue and make sure you dont disturb the html and if you choose to do so, make sure you make the necessary css changes
I changed
<section id="main">in functions.php to<section id="primary" class="content-area">and the sidebar widgets seems to be in the right place now. However that dropdown list in the sidebar is not aligned. Is this is a css issue?Ok, that was not the solution.
I cant find the file in which<div id="container">is located.what do you mean by you cant find the file?
If you know how to do a search using the editor you are using, then do it.
I did search all the theme files but I cant find which file contains
<div id="container">.
Maybe its Woocommerce that adds this?Might be WooCommerce does it. Please have a look and make the necessary changes. You can find this article helpful.
The topic ‘Misplaced sidebar widgets’ is closed to new replies.
