Title: CSS &amp; Loop &#8212; Post Icon &amp; Post Alignment Problems
Last modified: August 20, 2016

---

# CSS & Loop — Post Icon & Post Alignment Problems

 *  Resolved [achaplin](https://wordpress.org/support/users/achaplin/)
 * (@achaplin)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/css-loop-post-icon-post-alignment-problems/)
 * I’m new at developing themes, and I’ve run into a snag. I got the hang of the
   loop and using it to insert a category icon. Where I seem to be having trouble
   is in the alignment of my posts. The first post is aligned perfectly, the icon
   is to the left, and the post text and all following displays to the right. My
   problem is the posts following. I posted a screen shot here: [http://gb-dev.seagulllighting.com/blog/blogscreenshot.cfm](http://gb-dev.seagulllighting.com/blog/blogscreenshot.cfm)(
   the actual blog site is currently not active outside the building).
 * Here is my code for index.php:
 * <?php get_header(); ?>
 * <div class=”maincontent” id=”maincontent”>
    <div class=”latestentries” id=”latestentries”
   > <div class=”contentheader” id=”contentheader”> <div class=”colorblock” id=”
   colorblock”></div> <span class=”typepadding”>LATEST ENTRIES</span></div>
 * <div class=”entry” id=”entry”>
    <div class=”posticonbox” id=”posticonbox”><?php
   if (have_posts()) : while (have_posts()) : the_post(); if (function_exists(‘get_cat_icon’))
   get_cat_icon(‘fit_width=50&fit_height=50&small=true&class=reflect’); ?></div>
   <div class=”post” id=”post”>
 *  <div id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
    <div>
 * </h1>
    <div class=”postinfo”><?php the_time( ‘F j, Y’ ); ?><span> by </span><?
   php the_author(); ?></div> </div><!–end post header–> <div>
 *  <div class=”content” id=”content”><?php the_content(); ?></div>
    <ul class=”
   ulstyle”>
    - learn more about category
    - more by this author
    -  <?php wp_link_pages(); ?>
    - <div><?php comments_popup_link( ‘Leave a Comment’, ‘1 Comment’, ‘% Comments’);?
      ></div><?php edit_post_link(); ?>
    -  </div><!–end post footer–>
       </div><!–end post–> <div class=”border” id=”border”
      ></div>
    - <?php endwhile; /* rewind or continue if all posts have been fetched */ ?>
      
      <div> <div><?php next_posts_link( ‘Older Entries’ ); ?></div> <div><?php previous_posts_link(‘
      Newer Entries’ ); ?></div> </div><!–end navigation–> <?php else : ?> <?php
      endif; ?>
    - </div>
       </div></div>
    - <?php get_sidebar(); ?>
       <?php get_footer(); ?>
    - Any suggestions would be greatly appreciated.

The topic ‘CSS & Loop — Post Icon & Post Alignment Problems’ is closed to new replies.

## Tags

 * [alignment](https://wordpress.org/support/topic-tag/alignment/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [div](https://wordpress.org/support/topic-tag/div/)
 * [loop](https://wordpress.org/support/topic-tag/loop/)

 * 0 replies
 * 1 participant
 * Last reply from: [achaplin](https://wordpress.org/support/users/achaplin/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/css-loop-post-icon-post-alignment-problems/)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
