Remove sidebar from sydney theme
-
Hi,
I have looked everywhere for a solution to remove the sidebare from my main page.
I have added the following code to the Sydney style sheet css (Appearence > Editor):
/* remove parent sidebars */
function aquatify_remove_sydney_sidebars() {
unregister_sidebar( ‘sidebar-1’ ); // primary on left
unregister_sidebar( ‘sidebar-2’ ); // secondary on right
}
add_action( ‘widgets_init’, ‘aquatify_remove_sydney_sidebars’, 11 );And even removed this code: <?php get_sidebar(); ?>
Nothing has worked here. please can somebody help me?
Thanks in advance.
-
me too, this is driving me nuts.
Go into Appearance > customize > blog options, under layout and select “Full width (on sidebar)”
You might have to go into your css and add the following:
.col-md-9 {width:100%};This will give you the full width of the site. I created a child theme and added it to the Style.css there. I hope that helps!
this is driving me crazy, the theme is perfect for what a want but i have the same problem!! where can i delete or disable the side bar in the hole site, and also, is there an option for having the main page, where the slider is, with no content down the slider, just the slider and then the button will take me to another page, but no content in the main page? HELP SOS =( =( Thanks
pd: my english is not the best 😉
After around 4 hours of tinkering around, I’ve found it (I tested it out using the child theme I suggest you do too)
1) Go to the page.php file and remove <?php get_sidebar(); ?>
2) Change <div id=”primary” class=”content-area col-md-9″> to <div id=”primary” class=”content-area col-md-12″>
So now your page.php code should look like –
<?php
/**
* The template for displaying all single posts.
*
* @package Sydney
*/get_header(); ?>
<?php if (get_theme_mod(‘fullwidth_single’)) { //Check if the post needs to be full width
$fullwidth = ‘fullwidth’;
} else {
$fullwidth = ”;
} ?><div id=”primary” class=”content-area col-md-12 <?php echo $fullwidth; ?>”>
<main id=”main” class=”post-wrap” role=”main”><?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( ‘content’, ‘single’ ); ?>
<?php sydney_post_navigation(); ?>
<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?><?php endwhile; // end of the loop. ?>
</main><!– #main –>
</div><!– #primary –><?php get_footer(); ?>
—Hope it helps.
EDIT: Also, this should mean that there should be no “sidebar” widget under Appearance > Customize > Widgets . If you still see it and the sidebar still remains, I suggest you undo the whole thing and manually remove(delete by clicking on each one: widget > sidebar > menuname > delete) all the menus and THEN deleting the code.
Thank you very much Zee92, it’s a great help.
Hello people!
Working on php files in Your child theme is ok, but it’s important to understand that this way You will never get updates for that file. Infact wordpress will load Yours instead of the file provided by the theme author and when the theme will be upgraded with some new features, You will never see them.
For such small edits it is important to learn some php and js basics.
Inside Your “functions.php” You shall link a “custom.js” where making Your edits.
example:wp_register_script('main_js', get_bloginfo('stylesheet_directory') . '/custom.js', array('jquery'), '1.0' ); wp_enqueue_script('main_js');Once You’ve done that, You need to create a new file in the child theme’s folder, named custom.js containing the following rows:
jQuery(function($) { // Change bootstrap size to full size for pages $( "#primary").removeClass('col-md-9'); $( "#primary").addClass('col-md-12'); });I hope I have been clear and to have been useful to somebody!
Yes. Thanks, @zee92 for the advice. Worked a charm for me.
Cheers,
-Philip
The topic ‘Remove sidebar from sydney theme’ is closed to new replies.
