Title: Adding Class
Last modified: January 13, 2017

---

# Adding Class

 *  Resolved [ragnar22](https://wordpress.org/support/users/ragnar22/)
 * (@ragnar22)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/adding-class/)
 * Hi guys i have question..
 * how to do in wordpress to put an individual CLASS in a “the_title()” with a 5
   post title within on it.?
 * thanks..
    -  This topic was modified 9 years, 5 months ago by [ragnar22](https://wordpress.org/support/users/ragnar22/).

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

 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/adding-class/#post-8649374)
 * I’m not sure if I understand your question.
 * If you you want to add a span class in the post title, try using a filter on 
   the_title():
 *     ```
       function add_span($title, $id) {
   
           return $title .' <span class="title_span">' .get_post_meta($post_id, $key, $single) ."</span>";
   
       }
   
       add_filter('the_title', 'add_span', 10, 2);
       ```
   
 *  Thread Starter [ragnar22](https://wordpress.org/support/users/ragnar22/)
 * (@ragnar22)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/adding-class/#post-8649419)
 * hi [@t-p](https://wordpress.org/support/users/t-p/),, thanks for the reply..i
   found already a solution..by using this code
 * id=”post-<?php the_ID(); ?>”
 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/adding-class/#post-8649456)
 * Glad to know it 🙂
 *  Thread Starter [ragnar22](https://wordpress.org/support/users/ragnar22/)
 * (@ragnar22)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/adding-class/#post-8649663)
 * thanks..hoping you can use that code someday..:)
 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/adding-class/#post-8651868)
 * Thanks 🙂

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

The topic ‘Adding Class’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 5 replies
 * 2 participants
 * Last reply from: [t-p](https://wordpress.org/support/users/t-p/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/adding-class/#post-8651868)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
