Title: [Theme: ColorMagic] Adding post date
Last modified: August 20, 2016

---

# [Theme: ColorMagic] Adding post date

 *  [ivantoar](https://wordpress.org/support/users/ivantoar/)
 * (@ivantoar)
 * [14 years ago](https://wordpress.org/support/topic/theme-colormagic-adding-post-date/)
 * Hi, how can I add post date in every post (index and content)? I want to add 
   post date so readers will know when the content is published. Thanks in advance.
 * [http://wordpress.org/extend/themes/colormagic/](http://wordpress.org/extend/themes/colormagic/)

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [egado](https://wordpress.org/support/users/egado/)
 * (@egado)
 * [14 years ago](https://wordpress.org/support/topic/theme-colormagic-adding-post-date/#post-2727702)
 * Have a closer look to: [http://codex.wordpress.org/Function_Reference/the_date](http://codex.wordpress.org/Function_Reference/the_date)
 * you will need to add something like
    `<p>Date posted: <?php the_date(); ?></p
   >`
 * in your index.php and single.php… dont know the theme, but you better create 
   a childtheme first [http://codex.wordpress.org/Child_Themes](http://codex.wordpress.org/Child_Themes)
 *  Thread Starter [ivantoar](https://wordpress.org/support/users/ivantoar/)
 * (@ivantoar)
 * [14 years ago](https://wordpress.org/support/topic/theme-colormagic-adding-post-date/#post-2727724)
 * Seems like my index.php don’t contain code that relates to categories, tags, 
   or permalinks. However, I have content-single.php and content.php in my theme,
   should I add the code inside those two files?
 *  [egado](https://wordpress.org/support/users/egado/)
 * (@egado)
 * [14 years ago](https://wordpress.org/support/topic/theme-colormagic-adding-post-date/#post-2727732)
 * Yes… there where you want to output the post date
 * e.g. for content.php
 *     ```
       <header class="entry-header">
           <h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'colormagic' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
             <?php the_title(); ?>
             </a></h1>
             <p>Date posted: <?php the_date(); ?></p>
         </header>
       ```
   
 * e.g. for content-single.php
 *     ```
       <header class="entry-header">
           <h1 class="entry-title">
             <?php the_title(); ?>
           </h1>
           <p>Date posted: <?php the_date(); ?></p>
         </header>
         <!-- .entry-header -->
       ```
   
 * If you also need the post time, not only the post date you will find the code
   right here: [http://codex.wordpress.org/Function_Reference/the_time](http://codex.wordpress.org/Function_Reference/the_time)
 * Does that work for you?
 *  Thread Starter [ivantoar](https://wordpress.org/support/users/ivantoar/)
 * (@ivantoar)
 * [14 years ago](https://wordpress.org/support/topic/theme-colormagic-adding-post-date/#post-2727743)
 * It works for most of the posts. I wonder why the date doesn’t appear in some 
   post.
 * On most of the posts, it shows correctly like “24 January 2012”, on other posts,
   it just shows like “php the_date(); ?>”.
 * Thanks for your help 🙂
 *  [egado](https://wordpress.org/support/users/egado/)
 * (@egado)
 * [14 years ago](https://wordpress.org/support/topic/theme-colormagic-adding-post-date/#post-2727746)
 * Can you pls post the code section where you have add date function… not everything
   just 5 or 10 lines around it…
 *  Thread Starter [ivantoar](https://wordpress.org/support/users/ivantoar/)
 * (@ivantoar)
 * [14 years ago](https://wordpress.org/support/topic/theme-colormagic-adding-post-date/#post-2727753)
 * Sure, why not.
 * This is my content.php
    [http://pastebin.com/wqwCrrsP](http://pastebin.com/wqwCrrsP)
 * and this is my content-single.php
    [http://pastebin.com/XJgzMf47](http://pastebin.com/XJgzMf47)
 * This is the screenshot of my WordPress site. You can see that on the fist post,
   there is a date appears under the post title, but the date doesn’t appear on 
   the second post.
 * [http://imageshack.us/photo/my-images/28/clipboard01zx.jpg](http://imageshack.us/photo/my-images/28/clipboard01zx.jpg)
 *  Thread Starter [ivantoar](https://wordpress.org/support/users/ivantoar/)
 * (@ivantoar)
 * [14 years ago](https://wordpress.org/support/topic/theme-colormagic-adding-post-date/#post-2727862)
 * I realized that my content-single.php I mistyped
    `<p>php the_date(); ?></p>`
   instead of `<p><?php the_date(); ?>
 * It fixes the date when seeing the content BUT date still doesn’t appear in all
   posts in the index.
 * What did I do wrong?
 *  [egado](https://wordpress.org/support/users/egado/)
 * (@egado)
 * [14 years ago](https://wordpress.org/support/topic/theme-colormagic-adding-post-date/#post-2727864)
 * hm… I can’t see anything wrong… ok i’m very tired and need to sleep now 🙂
    If
   noone will see whats going wrong, I will test the theme tomorrow by myself to
   see what happends…
 *  Thread Starter [ivantoar](https://wordpress.org/support/users/ivantoar/)
 * (@ivantoar)
 * [14 years ago](https://wordpress.org/support/topic/theme-colormagic-adding-post-date/#post-2727931)
 * I still can’t get it working properly. I contacted the theme author 3 days ago.
   I will update results if anyone interested.
 * However, theme author haven’t get back to me yet. This topic is still open for
   help.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘[Theme: ColorMagic] Adding post date’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/colormagic/1.0.5/screenshot.png)
 * ColorMagic
 * [Support Threads](https://wordpress.org/support/theme/colormagic/)
 * [Active Topics](https://wordpress.org/support/theme/colormagic/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/colormagic/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/colormagic/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [ivantoar](https://wordpress.org/support/users/ivantoar/)
 * Last activity: [14 years ago](https://wordpress.org/support/topic/theme-colormagic-adding-post-date/#post-2727931)
 * Status: not resolved