Title: Title Formating &#8211; href vs echo
Last modified: August 19, 2016

---

# Title Formating – href vs echo

 *  Resolved [spowers33](https://wordpress.org/support/users/spowers33/)
 * (@spowers33)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/title-formating-href-vs-echo/)
 * Trying to hack a theme to put the title where the theme typically has the date.
   Don’t really know PHP, and educated guesses got me only so far. I got the title
   in place, with the link, but lose the formatting of the original.
 * So I included both lines of code below. The first, with href, has the title and
   the link, but I can’t get the CSS formating to transfer. The second, with echo,
   is the original code that publishes the date – with no link. Any suggestions 
   to get the href code to work, but keep the formatting of the echo line, will 
   be definitely appreciated.
 *     ```
       <!-- Blog Post -->
               <div class="ribbon">
               <div class="wrapAround"></div>
               <div class="tab">
                       <a href="<?php echo get_permalink(); ?>" class="blogDate"><?php echo get_the_title();  ?></a>
                       <div class="blogDate"><?php echo ' <span class="blogDate">'. get_the_title() .'</span> '; ?></div>
       ```
   
 * I put both lines on my site for now, which is [http://www.myfriendsareretarded.com](http://www.myfriendsareretarded.com).
   Thanks again.

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/title-formating-href-vs-echo/#post-1893326)
 * try and consolidate this:
 *     ```
       <a href="<?php echo get_permalink(); ?>" class="blogDate"><?php echo get_the_title();  ?></a>
                       <div class="blogDate"><?php echo ' <span class="blogDate">'. get_the_title() .'</span> '; ?></div>
       ```
   
 * into this:
 * `<div class="blogDate"><span class="blogDate"><a href="<?php the_permalink();?
   >" class="blogDate"><?php the_title(); ?></a></span></div>`
 *  Thread Starter [spowers33](https://wordpress.org/support/users/spowers33/)
 * (@spowers33)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/title-formating-href-vs-echo/#post-1893349)
 * What took you moments, would have taken me numerous hours and Tylenol. Thank 
   you so much, it worked beautifully.

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

The topic ‘Title Formating – href vs echo’ is closed to new replies.

## Tags

 * [formating](https://wordpress.org/support/topic-tag/formating/)
 * [href](https://wordpress.org/support/topic-tag/href/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [spowers33](https://wordpress.org/support/users/spowers33/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/title-formating-href-vs-echo/#post-1893349)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
