Title: Where should I put this code??
Last modified: August 20, 2016

---

# Where should I put this code??

 *  [chrisgeo](https://wordpress.org/support/users/chrisgeo/)
 * (@chrisgeo)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/where-should-i-put-this-code/)
 * Hi. I am trying to get wordpress to have set titles of each post based on Category–
   Day – Date. I edited the single.php file and it’s working!! The only problem 
   is the title doesn’t show up as a “title” in the category view or when the front
   page is pulling a list of posts.
 * Where should I post this code to make it happen??
 *     ```
       <?php
       $today = get_the_date($d, $the_post->post_parent);
       $day = date("l");
       $categories = get_the_category($postID);
   
       ?>
   
       <h1 class="content-title"><?php echo $categories[0]->cat_name ?> - <?php echo $day?> - <?php echo $today?></h1>
   
       The website is:
   
       http://truthfrequencyradio.com/network
       ```
   

Viewing 1 replies (of 1 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/where-should-i-put-this-code/#post-2405529)
 * to find what template is used when, see:
    [http://codex.wordpress.org/Template_Hierarchy](http://codex.wordpress.org/Template_Hierarchy)
 * you possibly need to edit index.php and category.php (or archive.php)

Viewing 1 replies (of 1 total)

The topic ‘Where should I put this code??’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/where-should-i-put-this-code/#post-2405529)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
