• Hi!

    There is something really weird going on on my site. I am using Oxygen Theme but I have made a few changes to the markup to make the footer fill the whole page.

    The template works fine until I upload a post – when I do that my sidebar (with the calendar widget) jumps down and the footer goes back to the original width (980px I think).

    I can add an additional closing div-tag after the sidebar-template to make it look fine again. But then, as soon as I delete a post, the problem is there again, and I have to remove the div-tag I just added!

    What have I done wrong? Here is the site: https://shpg.se

Viewing 5 replies - 1 through 5 (of 5 total)
  • Please validate your site’s markup.
    https://validator.w3.org/

    There might be something wrong in the quote widget because the validator says there’s a stray end tag and unclosed one on q

    and the weird one is that it says there is unclosed element <div id="container"> so please see to it that you got this right or not, probably in the footer.php.

    Also this fixed pixel shouldn’t be used at all, it’ll mess the responsiveness of site’s layout.

    #sidebar-secondary {
    	width: 250px;
    }

    Thread Starter lisasundberg

    (@lisasundberg)

    I have tried to remove the quote widget and to deactivate the quote plugin and that did not change anything.

    I added two closing div-tags to the footer template which made it work until the moment I deleted one post. Then I deleted one of the closing div-tags and now it looks good again.

    Tried to validate but I am not very good at interpreting what the errors mean…:S

    If not already yet, backup your child theme first.

    Then delete the footer.php from your child theme folder so that it will use the original one from parent.

    View the site with and without the quote widget, this will quickly and easily rule out if there is a missing unclosed </div> tag in your footer or not.

    which made it work until the moment I deleted one post.

    this points to an unmatched number of opening/closing divs within the loop.

    made a few changes to the markup to make the footer fill the whole page

    what changes exactly, in what templates?

    btw:
    it would be helpful to allow troubleshooting if the site would actually show the error while this topic is unresolved.

    Thread Starter lisasundberg

    (@lisasundberg)

    After many hours of testing around I believe I have figured out what causes the problem.

    Since I don’t want the default secondary feed called “more articles” on my front page, I had simply set the following div to display:none.

    <div class="hfeed-more">				
    
    					<?php $args = array( 'post__not_in' => get_option( 'sticky_posts' ), 'posts_per_page' => 12, 'meta_key' => '_oxygen_post_location', 'meta_value' => 'secondary' ); ?>
    
    					<?php $loop = new WP_Query( $args ); ?>
    
    					<?php if ( $loop->have_posts() ) : ?>
    
    						<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
    
    							<div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">
    
    								<h2 class="post-title entry-title">
    									<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
    								</h2>
    
    								<?php echo apply_atomic_shortcode( 'byline', '<div class="byline">' . __( '[entry-published] / by [entry-author] / in [entry-terms taxonomy="category"] [entry-edit-link before=" / "]', 'oxygen' ) . '</div>' ); ?>
    
    							</div><!-- .hentry -->
    
    						<?php endwhile; ?>			
    
    					<?php else : ?>
    
    						<?php get_template_part( 'loop-error' ); // Loads the loop-error.php template. ?>
    
    					<?php endif; ?>				
    
    				</div><!-- .hfeed-more -->

    I guess some of those rows were necessary to keep the page the way it should be. Does somebody have an idea of how I can remove (or just hide) the secondary feed without messing up the code?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Template changes when uploading a post’ is closed to new replies.