Community Forums › Forums › Archived Forums › General Discussion › Remove .sidebar-primary in footer
Tagged: remove sidebar
- This topic has 7 replies, 3 voices, and was last updated 8 years, 7 months ago by naveenkarolla.
-
AuthorPosts
-
June 8, 2016 at 5:56 pm #187203moccaMember
Hi!
I want to remove the primary sidebar <aside> in the footer.
Markup:
<footer class="site-footer" itemscope="" itemtype="http://schema.org/WPFooter"> <div class="wrap"> <aside class="sidebar sidebar-primary widget-area" role="complementary" aria-label="Primary Sidebar" itemscope="" itemtype="http://schema.org/WPSideBar" id="genesis-sidebar-primary"> <h2 class="genesis-sidebar-title screen-reader-text">sidebar</h2> </aside> <p class="left">Lorem Ipsum</p> <p class="right">Lorem Ipsum</p> </div> </footer>
But this code
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
… doesn’t remove the surrounding markup <aside …><h2>Sidebar</h2></aside>. I want to get rid of the <aside>…</aside> and everything in between.
In genesis/sidebar.php is this code:
do_action( 'genesis_before_sidebar_widget_area' ); do_action( 'genesis_sidebar' ); do_action( 'genesis_after_sidebar_widget_area' );
If I change do_action in remove_action (in my functions.php) nothing happens:
remove_action( 'genesis_before_sidebar_widget_area' ); remove_action( 'genesis_sidebar' ); // this only removes the <div class=”widget widget_text“> remove_action( 'genesis_after_sidebar_widget_area' );
What make I wrong?
June 9, 2016 at 5:13 pm #187275Victor FontModeratorWhy not just unregister the sidebar?
unregister_sidebar( 'sidebar' );
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?June 10, 2016 at 3:48 am #187313moccaMemberOh, I didn't write that I had also unregistered the sidebar already. But that didn't work - but should (if you suggest it). If the code above is correct the mistake must be somewhere else.
June 10, 2016 at 5:47 am #187323Victor FontModeratorPlacing the sidebar in the footer is very unusual. Whomever placed the sidebar in the footer should have done so in functions.php. It's also possible they created their own footer.php. Without access to the site, or at least to a gist of functions.php, it's impossible to tell you what's happening.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?June 11, 2016 at 3:25 pm #187391moccaMemberIn the meantime I tried to find out which part in the functions.php moves the sidebar within the site-footer. It’s the code in the footer section (line 133ff). I want to move the site-footer div and the footer-widget div into the site-container with this code. When I delete the code in this footer section of my functions.php the sidebar is placed between the site-container and the footer-widget div. It doesn’t disappear but only changes its position.
The only thing I want to do is to remove it. I don’t know why it’s so persistent.
These two lines don't help:
unregister_sidebar( 'sidebar' ); unregister_sidebar( 'sidebar-alt' );
This is the link to the functions.php: https://www.dropbox.com/s/qyaf9d23er6bpbr/functions.php?dl=0
Screenshot of the DOM: https://www.dropbox.com/s/saespxdilcftki8/Bildschirmfoto%202016-06-11%20um%2023.16.28.jpg?dl=0It would be great if you could take a look on it.
June 11, 2016 at 5:16 pm #187397Victor FontModeratorThere's nothing in the functions file to cause this. When I compare your source code to one of my sites, I can see a clear difference. On my site there is an id="genesis-sidebar-primary" in the sidebar aside. This ID is missing in your code which leads me to believe it is not generated by Genesis. Have you looked at text widgets in the footer or the Genesis Simple Edits plugin for the hard coded source?
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?June 11, 2016 at 6:02 pm #187401moccaMemberOh, I have this id also. It was just cropped in the screenshot.
As you couldn't find a mistake in the functions.php I searched the error somewhere else. Finally I found it in the WP admin 🙂 The default layout was set to the one with the sidebar. I changed the setting to full page et voilà 🙂
Thank you very much for your support, Victor!!!
June 12, 2016 at 9:16 pm #187455naveenkarollaMemberif you are using wordpress platform.. go to the Appearance>>Editor and then your theme editor code will be appeared.. on the right side, click on the side bar.. then removie all the coding there... :
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.