Title: Title display problem
Last modified: August 19, 2016

---

# Title display problem

 *  [redbourn](https://wordpress.org/support/users/eagerwatcher/)
 * (@eagerwatcher)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/title-display-problem/)
 * Hi,
 * I’ve been entering the titles on two of my sites like this;
 * <p align=”center”>Title display problem</p>
 * On one site, [http://www.ourchangingglobe.com](http://www.ourchangingglobe.com)
   it works fine.
 * But on the other site [http://misconceptions.us](http://misconceptions.us)
 * The title displays like this;
 * Did Mankind Really Progress?
    “>
 * Any ideas how I can get rid of the “> ?
 * Any help would be much appreciated.
 * Thank you,
 * Jane

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/title-display-problem/#post-2074551)
 * Check your markup. I see:
 * `<a center"="" title="<p align=" href="http://misconceptions.us/did-mankind-really-
   progress/">Did Mankind Really Progress?<p></p>"><p align="center">Did Mankind
   Really Progress?</p></a>`
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/title-display-problem/#post-2074557)
 * this is the html code as seen from the browser:
 * `<h2><a href="http://misconceptions.us/did-mankind-really-progress/" title="<
   p align="center">Did Mankind Really Progress?</p>"><p align="center">Did Mankind
   Really Progress?</p></a></h2>`
 * besides being invalid html, it also breaks the output – you get the “> and the
   title twice.
 * reason: the html of your title is pulled into the title attribute of the link;
 * if you know where to access the code (possibly in index.php within the loop),
   try to change the code which looks probably like (or very similar):
 * `<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php 
   the_title(); ?></a></h2>`
 * into:
    `<h2><a href="<?php the_permalink(); ?>" title="<?php echo strip_tags(
   get_the_title()); ?>"><?php the_title(); ?></a></h2>`
 * leave the centering of the title to the stylesheet:
 * add `text-align: center;` to this style in style.css of your theme:
 *     ```
       .post h2 {
       	width: 486px;
       	line-height: 20px;
       	margin: 0 0 0 0px;
       	padding: 0px 0px 0px 0px;
       	font-size: 1.6em; /* Post title */
       }
       ```
   
 *  Thread Starter [redbourn](https://wordpress.org/support/users/eagerwatcher/)
 * (@eagerwatcher)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/title-display-problem/#post-2074606)
 * Thank you alchymyth and esmi.
 * I made the changes to the code in the index.php and the stylesheet.
 * The stylesheet one works fine and when I tried a new article the title centered.
 * But the other change has not stripped out the “>
 * I checked in three browsers and cleared the cache.
 * Be a pity if I have to do it manually 🙁
 * Jane
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/title-display-problem/#post-2074616)
 * Instead of `title="<?php echo strip_tags(get_the_title()); ?>"`, try using `title
   ="<?php the_title_attribute(); ?>"`.
 * [http://codex.wordpress.org/Function_Reference/the_title_attribute](http://codex.wordpress.org/Function_Reference/the_title_attribute)
 *  Thread Starter [redbourn](https://wordpress.org/support/users/eagerwatcher/)
 * (@eagerwatcher)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/title-display-problem/#post-2074631)
 * [@esmi](https://wordpress.org/support/users/esmi/)
 * Didn’t work either and I’ve gone back to the original code before going to bed.
 * Maybe the change needs to be made in more than just the one page?
 * And strange (to me anyway) that [http://www.ourchangingglobe.com](http://www.ourchangingglobe.com)
   doesn’t have the problem.
 * Jane
 *  Thread Starter [redbourn](https://wordpress.org/support/users/eagerwatcher/)
 * (@eagerwatcher)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/title-display-problem/#post-2074876)
 * I did consider trying to correct this via phpMyAdmin but finally went back and
   corrected the problem manually.
 * But thanks for the help.
 * I was silly, and should have simply looked at a way of centering the text using
   CSS rather than adding html to each post.
 * Jane

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

The topic ‘Title display problem’ is closed to new replies.

## Tags

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

 * 6 replies
 * 3 participants
 * Last reply from: [redbourn](https://wordpress.org/support/users/eagerwatcher/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/title-display-problem/#post-2074876)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
