Title: Column Alignment issue
Last modified: August 19, 2016

---

# Column Alignment issue

 *  [NazreenCuthbert](https://wordpress.org/support/users/nazreencuthbert/)
 * (@nazreencuthbert)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/column-alignment-issue/)
 * Hi,
    I’ve done some tweaking to a php file and I can’t seem to fix the alignment
   of the columns the code I’ve used is
 *     ```
       <h1>Latest</h1>
   
       <div class="one_fourth"><h6> <p class="postmetadata">Latest In Photography</p></h6>
       <p>
         <?php query_posts('cat=37&showposts=1'); ?>
        <!-- Start the Loop. -->
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
   
        <!-- The following tests if the current post is in category 58. -->
        <!-- If it is, the div box is given the CSS class "post-cat-fifty-eight". -->
        <!-- Otherwise, the div box will be given the CSS class "post". -->
        <?php if ( in_category('37') ) { ?>
                  <div class="post-cat-fifty-eight">
        <?php } else { ?>
                  <div class="post">
        <?php } ?>
   
        <!-- Display the Post's Content in a div box. -->
        <div class="entry">
          		<?php
       		$post_image = get_post_meta($post->ID, 'post_image', true);
       		$post_image = webtreats_image_resize($height='127', $width='190', $post_image);
       		?>
   
       		<?php if ($post_image) { $counter++; ?>
   
       		<div id="image_loader_<?php echo $counter; ?>">
       				<a class="load_blog_img" title="<?php the_title(); ?>" href="<?php the_permalink(); ?>">
       					<img src="<?php echo $post_image; ?>" alt="" style="padding:4px;
       background: transparent; border: solid 1px #444e58" /></span>
       				</a>
       			</div>
       		</div>
   
       		<?php } ?>
        </div>
   
        <!-- Display the Title as a link to the Post's permalink. -->
        <p></p><h5><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h5>
   
        <a class="button_link" href="<?php the_permalink(); ?>"><span>VIEW</span></a>
   
        </div> <!-- closes the first div box -->
   
        <!-- Stop The Loop (but note the "else:" - see next line). -->
        <?php endwhile; else: ?>
   
        <!-- The very first "if" tested to see if there were any Posts to -->
        <!-- display.  This "else" part tells what do if there weren't any. -->
        <p>Sorry, no posts matched your criteria.</p>
   
        <!-- REALLY stop The Loop. -->
        <?php endif; ?>
       </p>
       </div><!-- one_fourth -->
   
       <div class="one_fourth"><h6>Latest In Videos</h6>
       <p> <?php query_posts('cat=45&showposts=1'); ?>
        <!-- Start the Loop. -->
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
   
        <!-- The following tests if the current post is in category 58. -->
        <!-- If it is, the div box is given the CSS class "post-cat-fifty-eight". -->
        <!-- Otherwise, the div box will be given the CSS class "post". -->
        <?php if ( in_category('45') ) { ?>
                  <div class="post-cat-fifty-eight">
        <?php } else { ?>
                  <div class="post">
        <?php } ?>
   
        <!-- Display the Post's Content in a div box. -->
        <div class="entry">
          		<?php
       		$post_image = get_post_meta($post->ID, 'post_image', true);
       		$post_image = webtreats_image_resize($height='127', $width='190', $post_image);
       		?>
   
       		<?php if ($post_image) { $counter++; ?>
   
       		<div id="image_loader_<?php echo $counter; ?>">
       				<a class="load_blog_img" title="<?php the_title(); ?>" href="<?php the_permalink(); ?>">
       					<img src="<?php echo $post_image; ?>" alt="" style="padding:4px;
       background: transparent; border: solid 1px #444e58" /></span>
       				</a>
       			</div>
       		</div>
   
       		<?php } ?>
        </div>
   
        <!-- Display the Title as a link to the Post's permalink. -->
        <p></p><h5><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h5>
   
        <a class="button_link" href="<?php the_permalink(); ?>"><span>VIEW</span></a>
   
        </div> <!-- closes the first div box -->
   
        <!-- Stop The Loop (but note the "else:" - see next line). -->
        <?php endwhile; else: ?>
   
        <!-- The very first "if" tested to see if there were any Posts to -->
        <!-- display.  This "else" part tells what do if there weren't any. -->
        <p>Sorry, no posts matched your criteria.</p>
   
        <!-- REALLY stop The Loop. -->
        <?php endif; ?>
       </p>
       </div><!-- one_fourth -->
   
       <div class="one_fourth"><h6>Latest On Matt & Mayna</h6>
       <p> <?php query_posts('cat=119&showposts=1'); ?>
        <!-- Start the Loop. -->
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
   
        <!-- The following tests if the current post is in category 58. -->
        <!-- If it is, the div box is given the CSS class "post-cat-fifty-eight". -->
        <!-- Otherwise, the div box will be given the CSS class "post". -->
        <?php if ( in_category('119') ) { ?>
                  <div class="post-cat-fifty-eight">
        <?php } else { ?>
                  <div class="post">
        <?php } ?>
   
        <!-- Display the Post's Content in a div box. -->
        <div class="entry">
          		<?php
       		$post_image = get_post_meta($post->ID, 'post_image', true);
       		$post_image = webtreats_image_resize($height='127', $width='190', $post_image);
       		?>
   
       		<?php if ($post_image) { $counter++; ?>
   
       		<div id="image_loader_<?php echo $counter; ?>">
       				<a class="load_blog_img" title="<?php the_title(); ?>" href="<?php the_permalink(); ?>">
       					<img src="<?php echo $post_image; ?>" alt="" style="padding:0px;
       background: transparent; border: solid 5px #444e58" /></span>
       				</a>
       			</div>
       		</div>
   
       		<?php } ?>
        </div>
   
        <!-- Display the Title as a link to the Post's permalink. -->
        <p></p><h5><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h5>
   
        <a class="button_link" href="<?php the_permalink(); ?>"><span>VIEW</span></a>
   
        </div> <!-- closes the first div box -->
   
        <!-- Stop The Loop (but note the "else:" - see next line). -->
        <?php endwhile; else: ?>
   
        <!-- The very first "if" tested to see if there were any Posts to -->
        <!-- display.  This "else" part tells what do if there weren't any. -->
        <p>Sorry, no posts matched your criteria.</p>
   
        <!-- REALLY stop The Loop. -->
        <?php endif; ?>
       </p>
       </div><!-- one_fourth -->
   
       <div class="one_fourth last"><h6 class="postmetadata">Latest From The Blog</h6>
       <p>
        <?php query_posts('cat=58&showposts=1'); ?>
        <!-- Start the Loop. -->
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
   
        <!-- The following tests if the current post is in category 58. -->
        <!-- If it is, the div box is given the CSS class "post-cat-fifty-eight". -->
        <!-- Otherwise, the div box will be given the CSS class "post". -->
        <?php if ( in_category('58') ) { ?>
                  <div class="post-cat-fifty-eight">
        <?php } else { ?>
                  <div class="post">
        <?php } ?>
   
        <!-- Display the Post's Content in a div box. -->
        <div class="entry">
          		<?php
       		$post_image = get_post_meta($post->ID, 'post_image', true);
       		$post_image = webtreats_image_resize($height='127', $width='190', $post_image);
       		?>
   
       		<?php if ($post_image) { $counter++; ?>
   
       		<div id="image_loader_<?php echo $counter; ?>">
       				<a class="load_blog_img" title="<?php the_title(); ?>" href="<?php the_permalink(); ?>">
       					<img src="<?php echo $post_image; ?>" alt="" style="padding:4px;
       background: transparent; border: solid 1px #444e58" /></span>
       				</a>
       			</div>
       		</div>
   
       		<?php } ?>
        </div>
   
        <!-- Display the Title as a link to the Post's permalink. -->
        <p></p><h5><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h5>
   
        <a class="button_link" href="<?php the_permalink(); ?>"><span>VIEW</span></a>
   
        </div> <!-- closes the first div box -->
   
        <!-- Stop The Loop (but note the "else:" - see next line). -->
        <?php endwhile; else: ?>
   
        <!-- The very first "if" tested to see if there were any Posts to -->
        <!-- display.  This "else" part tells what do if there weren't any. -->
        <p>Sorry, no posts matched your criteria.</p>
   
        <!-- REALLY stop The Loop. -->
        <?php endif; ?>
       </p>
       </div><!-- one_fourth -->
       ```
   
 * what this gives me is [ this](http://www.narrazeevisuals.com/Picture%204.png)
 * Any ideas on how I could fix it? Any help would be much appreciated!

Viewing 1 replies (of 1 total)

 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/column-alignment-issue/#post-1790067)
 * This is probably a [validation](http://validator.w3.org/check?uri=http%3A%2F%2Fnarrazeevisuals.com%2F&charset=%28detect+automatically%29&doctype=Inline&group=0)
   or css issue so a link to the website is the only way for someone to solve the
   issue.

Viewing 1 replies (of 1 total)

The topic ‘Column Alignment issue’ is closed to new replies.

## Tags

 * [category](https://wordpress.org/support/topic-tag/category/)
 * [columns](https://wordpress.org/support/topic-tag/columns/)
 * [loops](https://wordpress.org/support/topic-tag/loops/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/column-alignment-issue/#post-1790067)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
