Title: Post Class not displaying
Last modified: August 19, 2016

---

# Post Class not displaying

 *  Resolved [thinkofmedia](https://wordpress.org/support/users/thinkofmedia/)
 * (@thinkofmedia)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/post-class-not-displaying/)
 * I need to get the posts on beautyidentified.com to become side by side. But the
   post class function doesn’t add to the css.
 * Please can someone assist.
 *     ```
       <div class="post wrap">
   
       				<?php
                           // Split the main content pages from the options, and put in an array
                           $featpages = get_option('woo_main_pages');
                           $featarr=split(",",$featpages);
                           $featarr = array_diff($featarr, array(""));
                           $col = 1;
                       ?>
       				<?php foreach ( $featarr as $featitem ) { ?>
                       <?php query_posts('page_id=' . $featitem); ?>
   
                       <?php if (have_posts()) : while (have_posts()) : the_post(); ?>	
   
                       	<<?php if ($col == 1) echo "<div class=\"row\">"; ?>
       <div id="post col<?php echo $col;?>" id="post-<?php the_ID();<?php post_class(); ?>">
       <h2 class="post"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
       					<?php if ( get_post_meta($post->ID, 'image', true) ) { ?>
                           <img src="<?php echo get_post_meta($post->ID, "image", $single = true); ?>" alt="" class="home-icon" />
       					<?php } ?> 
   
                          <div <?php if ( get_post_meta($post->ID, 'image', true) ) { ?>class="feature"<?php } ?>>
   
                              <?php the_excerpt(); ?>
                              <a href="<?php the_permalink() ?>">Read more</a></p>
                           </div>
                           <div class="hr"></div>
              				 </div>
              				 </div>
       				<?php if ($col == 1) echo "</div>"; (($col==1) ? $col=2 : $col=1); endwhile; ?>
                       <?php endwhile; endif; ?>
                       <?php } ?>
       ```
   

Viewing 1 replies (of 1 total)

 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/post-class-not-displaying/#post-1379258)
 * You have a syntax error..
 *     ```
       <?php the_ID();<?php post_class(); ?>
       ```
   
 * Should be ..
 *     ```
       <?php the_ID(); ?><?php post_class(); ?>
       ```
   
 * or
 *     ```
       <?php the_ID(); post_class(); ?>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Post Class not displaying’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/post-class-not-displaying/#post-1379258)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
