Title: [Plugin: Subheading] default Subheading if is empty
Last modified: August 19, 2016

---

# [Plugin: Subheading] default Subheading if is empty

 *  Resolved [Bernhard](https://wordpress.org/support/users/bernhard-k/)
 * (@bernhard-k)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-subheading-default-subheading-if-is-empty/)
 * Hi,
 * I’m wondering that nobody asked this question before or that I didn’t find it:
 * I’d like to have a Subheading by default if none is written.
 * I imagine something like:
 *     ```
       <?php
       if ( !is_front_page() && (function_exists('the_subheading')) && ( !is_empty('subheading')) ) { the_subheading('<h2>', '</h2>'); }
       else { ?> <h2>default Subheading</h2>
       <?php } ?>
       ```
   
 * Is there any possibility?

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

 *  [Steve](https://wordpress.org/support/users/36flavours/)
 * (@36flavours)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-subheading-default-subheading-if-is-empty/#post-1806722)
 * Hi,
 * This is possible using something similar to the following:
 *     ```
       <?php
       if (!is_front_page() && function_exists('the_subheading')) {
       	$subheading = the_subheading('', '', false);
       	if (!empty($subheading)) {
       		the_subheading('<h2>', '</h2>');
       	} else {
       		?><h2>Default Sub Heading</h2><?php
       	}
       }
       ?>
       ```
   
 * You could have used the `get_the_subheading` function, but I spotted a bug with
   that!
 * Hope this helps 🙂
 *  Thread Starter [Bernhard](https://wordpress.org/support/users/bernhard-k/)
 * (@bernhard-k)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-subheading-default-subheading-if-is-empty/#post-1806761)
 * Hi,
 * Thank you very much for the fast support!
    That works perfectly!

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

The topic ‘[Plugin: Subheading] default Subheading if is empty’ is closed to new
replies.

## Tags

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

 * 2 replies
 * 2 participants
 * Last reply from: [Bernhard](https://wordpress.org/support/users/bernhard-k/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-subheading-default-subheading-if-is-empty/#post-1806761)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
