Support » Fixing WordPress » Sidebar displayed at bottom of page when page belongs to a parent

  • Resolved J Howard

    (@j-howard)


    What would be the first thing you would say to resolve an issue like the above? The problem is not apparent if the page has no parent.

    Many thanks.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Check for mark-up errors –

    http://validator.w3.org/

    Michael

    (@alchymyth)

    Forum Moderator

    the second thing is:
    please post a live link to your problem page so somebody else can help checking the issue…

    Here is a link to the page –
    http://www.thedash.org.uk/websitetest/school-info/test2/

    As mentioned, this behaviour only occurs, if the page belongs to a parent page.

    Many thanks in advance.

    Michael

    (@alchymyth)

    Forum Moderator

    are the child pages (or some of them) using a different page template?

    for instance, in your posted example link, there is the class .one-column in this div:

    <div id="container" class="one-column" >

    while this css class is missing in a parent page.

    you can check if and what page template is used when you edit the page, under ‘page attributes’ on the right.

    Hi Alchymyth – thanks for the reply.

    The issue occurs when the page uses a no sidebar template.

    Michael

    (@alchymyth)

    Forum Moderator

    The issue occurs when the page uses a no sidebar template.

    double check the code of that template file – there should be no ‘get_sidebar()’ code …

    Thanks for your efforts thus far, Alchymyth.

    I’ve checked the code for the template, and it is correct for showing no sidebar. I’ve even restored the template file from an old backup, which was exactly the same, but I thought I’d give it a shot anyway.

    So, which higher part of the tree should I concentrate my efforts on, if the template is correct?

    What could either be overriding the template (which would be weird just for one template), or ignoring the template altogether? It clearly isn’t working, as the sidebar DIV is being rendered within the page.

    More oddly, why would the sidebar template suddenly work as expected, when not associated with a parent page?

    Michael

    (@alchymyth)

    Forum Moderator

    I just tested the original ‘inove’ theme’s ‘page without sidebar’ template, on a child page, and it does not show a sidebar.

    generally, if and when a sidebar is added is actually coded in footer.php of the theme, depending on some global variables…

    what is the code of footer.php of your theme?

    </div>
    
    	<!-- main END -->
    
    	<?php get_sidebar(); ?>
    
    	<div class="fixed"></div>
    
    </div>
    
    <!-- content END -->
    
    <!-- footer START -->
    
    <div id="footer">
    <div id="copyright">
    <a href="http://twitter.com/wcess"><img src="http://www.thedash.org.uk/websitetest/wp-content/images/twittertrans.jpg" height="50px" width="60px" alt="Follow us!"/></a>&nbsp;&nbsp;
    <a href="http://www.facebook.com/pages/Wolverley-CE-Secondary-School/123500651006409"><img src="http://www.thedash.org.uk/websitetest/wp-content/images/facebooktrans.jpg" height="48px" width="48px" alt="Like us on Facebook!"/></a>&nbsp;&nbsp;
    <div id="copyrightright">
    <u><a href="http://www.thedash.org.uk/websitetest/wp-login.php">Login</a></u>
    </div>
    
    </div>
    </div>
    Michael

    (@alchymyth)

    Forum Moderator

    the original lines at the start of foter.php were:

    </div>
    	<!-- main END -->
    
    	<?php
    		$options = get_option('inove_options');
    		global $inove_nosidebar;
    		if(!$options['nosidebar'] && !$inove_nosidebar) {
    			get_sidebar();
    		}
    	?>
    	<div class="fixed"></div>
    </div>
    <!-- content END -->

    you could try to replace your lines with the original ones – make a backup of your files first.

    Alchymyth – I cannot thank you enough, not only for investigating the issue, but for also locating the original footer.php code for the ‘inove’ theme.

    I replaced the code in my current footer.php file, and it worked like a charm. No further issues whether linked or unlinked to a parent page. Many many thanks!!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Sidebar displayed at bottom of page when page belongs to a parent’ is closed to new replies.