Search code examples
htmlwordpresszurb-foundationgrid-layout

WordPress post messing up html grid


I have a WordPress post that everytime I post it my 3 column html grid is completely screwed up (things floating left, gaps in the grid where there should be an element.) But when I remove the post and refresh the page the grid is formatted exactly how it should be.

here is the main loop:

    <div id="howTo" class="howTo">
        <div class="small-12 columns mainWrap">
            <h1 class="text-center"><span class="cb-howTo"></span>Skills</h1>
            <?php $loop = new WP_Query( array( 'order' => 'asc', 'category_name' => 'des-skill') ); ?>
            <?php if ( have_posts() ) : while ( $loop->have_posts() ) : $loop->the_post(); ?>
                <a href="<?php the_permalink(); ?>">
                    <div class="small-12 medium-4 columns article">
                        <div class="articleImgWrap dzsparallaxer auto-init use-loading" data-options='{ direction: "normal" }'  role="banner">
                            <div class="articleImg dzsparallaxer--target" style="background-image: url('<?php echo wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) ); ?>');"></div>
                            <div class="imgOverlay">
                                <h4 class="text-center articleHead"><?php the_title(); ?></h4>
                            </div>
                        </div>
                        <div class="excerpt"><?php echo get_the_excerpt(); ?></div>
                    </div>
                </a>
            <?php endwhile; // end of the loop. ?>
            <?php endif; ?>
        </div>
    </div>

I am using foundation but again when I remove that one post the grid is fine.


Solution

  • The problem is that I think WordPress sees characters like < and > in the post title to be opening and closing parts of an html element. So what I think is happening is its prematurely closing off your html element in the loop. Try removing the ">" from the post title and see if that fixes the grid issues.