• Resolved sarugnate

    (@sarugnate)


    Hi,

    My footer isn’t aligned at the center on pages without a sidebar. On pages with a sidebar, the alignment is perfectly fine. Why is this happening? Can anyone help please?

    Here’s a link to the site I’m working on: http://www.thesuperwomanlifestyle.com/

    The home page has no sidebar so the footer isn’t aligned at the center. If you check other pages that have a sidebar, the alignment is alright.

    Please help!

Viewing 12 replies - 1 through 12 (of 12 total)
  • on an inside blog page that i see aligns correctly, the “insidewrap” div is closed before the “footer” div begins.

    on the home page, the “footer” div is completely inside the “insidewrap” div. the footer is not made to fit inside the “insidewrap” div.

    Thread Starter sarugnate

    (@sarugnate)

    thanks for the reply doman. I changed the code (to have it without borders) as a friend told me that on the home page, there was already a border for the footer (the reason being what you pointed out), so I didn’t need to put it there. Now my problem is, on pages with a sidebar, the footer no longer has that border. How do I give it that same pink border?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    The footer isn’t the one with the border, it’s ‘<div class="insidewrap">'.

    CSS is based on HTML structure and the HTML structure you have for the pages with the issues is different to that of the home page, you don’t have ‘<div class="insidewrap">‘ on the pages with the sidebar do you?

    Thread Starter sarugnate

    (@sarugnate)

    Hi Andrew! I don’t really know. If I have it on those pages, will the issue be resolved? If so, how do I add that? I’m sorry. I’m a noob at css and html…

    Thread Starter sarugnate

    (@sarugnate)

    Hmmm….using firebug, I see that there’s that part on insidewrap, but the footer is not inside it. On the homepage, the footer is inside the insidewrap div…will the problem get solved if I make a php condition to include the footer in the insidewrap?

    in the template for your pages with a sidebar you now need to put the footer inside the insidewrap div. just grab the closing </div> tag for insidewrap and put it below the closing </div> of your footer.

    Thread Starter sarugnate

    (@sarugnate)

    Hi dohman! Thanks for the response. I’m sorry for being such a noob, but where would I typically find that? I mean the file for the template….

    EDIT: I found a page.php and tried to move the /div for the container below the footer but it messes up the format..it did include the footer but the sidebar suddenly moved below the footer…err…could you walk me through where I should move the /div to? here’s the code:

    <?php
    /**
     * Page Template
     *
     * …
     *
     * @package Thematic
     * @subpackage Templates
     */
    
        // calling the header.php
        get_header();
    
        // action hook for placing content above #container
        thematic_abovecontainer();
    ?>
    
    		<div id="container">
    
    			<?php
    				// action hook for placing content above #content
    				thematic_abovecontent();
    
    				// filter for manipulating the element that wraps the content
    				echo apply_filters( 'thematic_open_id_content', '<div id="content">' . "\n" );
    
    				// calling the widget area 'page-top'
    	            get_sidebar('page-top');
    
    	            // start the loop
    	            while ( have_posts() ) : the_post();
    
    				// action hook for placing content above #post
    	            thematic_abovepost();
    	        ?>
    
    				<div id="post-<?php	 	 the_ID(); ?>" <?php	 	 post_class(); ?> > 
    
    				<?php	 	
    
    	                // creating the post header
    	                thematic_postheader();
    				?>
    
    					<div class="entry-content">
    
    						<?php
    	                    	the_content();
    
    	                    	wp_link_pages( "\t\t\t\t\t<div class='page-link'>" . __( 'Pages: ', 'thematic' ), "</div>\n", 'number' );
    
    	                    	edit_post_link( __( 'Edit', 'thematic' ), "\n\t\t\t\t\t\t" . '<span class="edit-link">' , '</span>' . "\n" );
    	                    ?>
    
    					</div><!-- .entry-content -->
    
    				</div><!-- #post -->
    
    			<?php
    				// action hook for inserting content below #post
    	        	thematic_belowpost();
    
           			// action hook for calling the comments_template
           			thematic_comments_template();
    
    	        	// end loop
            		endwhile;
    
    	        	// calling the widget area 'page-bottom'
    	        	get_sidebar( 'page-bottom' );
    	        ?>
    
    			</div><!-- #content -->
    
    			<?php
    				// action hook for placing content below #content
    				thematic_belowcontent(); 
    
    			?> 
    
    		</div><!-- #container -->
    <?php
        // action hook for placing content below #container
        thematic_belowcontainer();
    
        // calling the standard sidebar
        thematic_sidebar();
    
        // calling footer.php
        get_footer();
    ?>

    to confirm things before we go on, do you want all the pages to be like your home page now, with the footer inside the pink border?

    Thread Starter sarugnate

    (@sarugnate)

    Hi dohman. Yes, the footer should have a pink border around it so that it’s uniform all throughout the site. That means the footer should have a pink border regardless of whether the page has a sidebar or not. Thanks for all your help so far. 🙂

    for changing those inside pages i think you are best off just modifying the css. try adding these css properties.

    #insidewrap {
    border-bottom:none;
    }

    #footer {
    border: 13px solid #A21863;
    border-top: none;
    }

    this way it keeps your templates all in tact. the odd thing is your home page and inside pages are constructed differently which is what through everything off to begin with. hope this gets you off and running! 🙂

    oops, forgot about the home page. depending on how you fixed the home page before, the css above could change it. you may have to correct it using a css rule like:

    .home #footer {
    border: none;
    }

    Thread Starter sarugnate

    (@sarugnate)

    Dohman! That did it! Thank you so much! You’re such an angel! 😀 I wish there was a way to give you a thumbs up here. Thanks so much! 😀

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Footer does not align center on pages without sidebar’ is closed to new replies.