WordPress.org

Forums

[resolved] Sidebar displayed at bottom of page when page belongs to a parent (13 posts)

  1. J Howard
    Member
    Posted 1 year ago #

    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.

  2. WPyogi
    Forum Moderator
    Posted 1 year ago #

    Check for mark-up errors -

    http://validator.w3.org/

  3. alchymyth
    Forum Moderator
    Posted 1 year ago #

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

  4. J Howard
    Member
    Posted 1 year ago #

    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.

  5. alchymyth
    Forum Moderator
    Posted 1 year ago #

    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.

  6. J Howard
    Member
    Posted 1 year ago #

    Hi Alchymyth - thanks for the reply.

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

  7. alchymyth
    Forum Moderator
    Posted 1 year ago #

    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 ...

  8. J Howard
    Member
    Posted 1 year ago #

    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.

  9. J Howard
    Member
    Posted 1 year ago #

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

  10. alchymyth
    Forum Moderator
    Posted 1 year ago #

    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?

  11. J Howard
    Member
    Posted 1 year ago #

    </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>
  12. alchymyth
    Forum Moderator
    Posted 1 year ago #

    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.

  13. J Howard
    Member
    Posted 1 year ago #

    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!!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags