Support » Themes and Templates » Sidebar content pushed to bottom of page..??

  • Resolved Ncastro340

    (@ncastro340)


    Can anyone tell me why my recent posts(sidebar content) are being pushed all the way to the bottom of my pages(single post pages)..?

    My site is here

    thanks in advance.

Viewing 13 replies - 1 through 13 (of 13 total)
  • Start by sorting out the markup errors. Then move onto the CSS errors.
    http://codex.wordpress.org/Validating_a_Website

    Hi Ncastro340,

    Move your <div id="primary" class="widget-area" role="complementary"> back into the <div id="container">. It’s outside of it now, and that’s what’s pushing it down.

    Best,
    Connor

    To see what I mean, click here.

    Thread Starter Ncastro340

    (@ncastro340)

    I see <div id=”primary” class=”widget-area” role=”complementary”> in my sidebar.php, and I see the main content container in my page.php, but where can I edit the file with both of these strings of information..?

    What you have pointed out makes sense, but I do not see where I can edit this. If you could just point me in the right direction, I would rally appreciate it.

    Thanks for your help.

    It depends per theme, but chances are the page.php has the <div id="container"> in it, but it’s closed in sidebar.php. I am not sure how well commented it is, but check those out. What I’d do is open up sidebar.php, and see if there is a </div> before the <div id="primary">. If there is, just cut out the primary div and all of it’s contents and move them inside of the </div>.

    That should work!

    Thread Starter Ncastro340

    (@ncastro340)

    This is weird, it wasn’t like this a couple of days ago, the sidebar was functioning fine, and this is only happening on my single post pages. Here is my sidebar.php, and there is no div tags enclosing my “primary” id.

    <?php
    /**
     * The Sidebar containing the primary and secondary widget areas.
     *
     * @package WordPress
     * @subpackage Twenty_Ten
     * @since Twenty Ten 1.0
     */
    ?>
    
    		<div id="primary" class="widget-area" role="complementary">
    			<ul class="xoxo">
    
    <?php
    	/* When we call the dynamic_sidebar() function, it'll spit out
    	 * the widgets for that widget area. If it instead returns false,
    	 * then the sidebar simply doesn't exist, so we'll hard-code in
    	 * some default sidebar stuff just in case.
    	 */
    	if ( ! dynamic_sidebar( 'sidebar-right-one' ) ) : ?>

    And here is my page.php(the page type for my single posts), and there is no div enclosure before the container.

    <?php
    /**
     * The template for displaying all pages.
     *
     * This is the template that displays all pages by default.
     * Please note that this is the WordPress construct of pages
     * and that other 'pages' on your WordPress site will use a
     * different template.
     *
     * @package WordPress
     * @subpackage Twenty_Ten
     * @since Twenty Ten 1.0
     */
    
    get_header(); ?>
    
    		<div id="container">
    			<div id="content" role="main">
    
    <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

    I see why from what you have said, but I am still confused on where it is that I can edit this to fix the problem.

    Thanks for your help, I really appreciate it.

    Is that the entire page.php file? If not, could you please post it?

    Sorry you have to go through this! It’s difficult when I can’t actually be there… =/

    Thread Starter Ncastro340

    (@ncastro340)

    Here is all of my page.php
    I know it can’t be too difficult, i’m just not sure exactly “where” the problem is.

    [Code moderated as per the Forum Rules. Please use the pastebin]

    move </div><!-- #container --> to after the <?php get_sidebar(); ?> and that should do the trick!

    Thread Starter Ncastro340

    (@ncastro340)

    hmm, for some reason it is still displaying at the bottom of the page, maybe there is a plug in conflict. How can I set my archive pages(posts) to display a different page template? Because when I am at the post editing screen, I don’t see an option to change the page template. Or are page templates strictly PAGE (not post) templates..?

    That is because the container you using on the page to wide

    #container {
    margin:1% auto 1% 1%;
    padding:0;
    width:940px;

    narrow it and you will see the sidebar come up.
    the other thing I noticed is that you have two containers one with 940px and other one 100%

    Thread Starter Ncastro340

    (@ncastro340)

    Thanks it had to do with the second container. I made a container for my header logo and slideshow and named it container, but there was already an id# container. Once I changed the name of the second container all fell into place.
    Thanks for all the help!

    You are welcome.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Sidebar content pushed to bottom of page..??’ is closed to new replies.