Title: WordPress code
Last modified: October 29, 2016

---

# WordPress code

 *  [ltd2009](https://wordpress.org/support/users/ltd2009/)
 * (@ltd2009)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/wordpress-code/)
 * Hi everyone,
 * I am attempting to do some minor modifications to the home page of a wordpress
   instance.
 * The current code:
 *     ```
                          <div class="archive-post-header">
   
       		    <p class="archive-post-date"><?php the_time(get_option('date_format')); ?></p>
   
       		    <?php if ( get_the_title() != '' ) : ?>
       		    	<h2 class="archive-post-title"><?php the_title(); ?></h2>
       		    <?php endif; ?>
   
       		</div>
       ```
   
 * I’d to change it to:
 *     ```
       	<div class="archive-post-header">
   
       		    <p class="archive-post-date"><?php the_category( ', ' ); ?></p>
   
       		    <?php if ( get_the_title() != '' ) : ?>
       		    	<h2 class="archive-post-title"><?php the_title(); ?></h2>
       		    <?php endif; ?>
   
       		</div>
       ```
   
 * Basically, instead of outputing the date of the post, I’d like it to display 
   the categories that the post is tagged with.
 * The above (second) piece of code is obviously not working, any of you with coding
   experience probably know why right away.
 * Any insight into how I can change the code to work?
 * I’m hoping i can still use the post date class, as I like the way it looks… could
   just copy it and make a new class, but if that works it works right?

The topic ‘WordPress code’ is closed to new replies.

## Tags

 * [categories](https://wordpress.org/support/topic-tag/categories/)
 * [Coding](https://wordpress.org/support/topic-tag/coding/)

 * 0 replies
 * 1 participant
 * Last reply from: [ltd2009](https://wordpress.org/support/users/ltd2009/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/wordpress-code/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
