Title: Conditional Title Formatting
Last modified: August 19, 2016

---

# Conditional Title Formatting

 *  Resolved [showngo](https://wordpress.org/support/users/showngo/)
 * (@showngo)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/conditional-title-formatting/)
 * I am trying to have the Title of my posts be different based on the category 
   that they are filed under. I want to have all posts filed as a ‘link’ to be an
   h4 tag and all others be h1.
 * Basically if the category is noted as ‘links’ I want to display this:
 * `<h4><a href="<?php the_linked_list_link('url') ?>"><?php the_title(); ?></a>
   </h4>`
 * and if it is not I want to display this:
 * `<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link 
   to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>`
 * Any thoughts?
 * I am using the clean home theme with Jonathen Penn’s Linked List plugin.

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/conditional-title-formatting/#post-1492906)
 * try using `in_category('4')`
    [http://codex.wordpress.org/Conditional_Tags#A_Category_Page](http://codex.wordpress.org/Conditional_Tags#A_Category_Page)
 *     ```
       <?php if( in_category('4') ) : ?>
       <h4>.....</h4>
       <?php else : ?>
       <h1>.....</h1>
       <?php endif; ?>
       ```
   
 * use it whereever you want to show the title in this different way (index.php,
   single.php )
 *  Thread Starter [showngo](https://wordpress.org/support/users/showngo/)
 * (@showngo)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/conditional-title-formatting/#post-1492971)
 * That works, thank you!

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

The topic ‘Conditional Title Formatting’ is closed to new replies.

## Tags

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

 * 2 replies
 * 2 participants
 * Last reply from: [showngo](https://wordpress.org/support/users/showngo/)
 * Last activity: [16 years, 1 month ago](https://wordpress.org/support/topic/conditional-title-formatting/#post-1492971)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
