How To Add Secondary Title On WordPress Website Powered By Genesis

how to add secondary title to WordPress post

Recently one of our clients requested a feature to add secondary title to WordPress posts and pages. It is a great feature. It allows you to add an alternative title (or sub-heading) to your posts / pages. Or you can simply use this feature to add a tagline to your posts / pages. It comes in handy to explain the purpose of the post (or the page).

Having a secondary title is also a good idea from on-page SEO point of view. While you can include the main keyword(s) in post title, you can use LSI (latent semantic indexing) terms in secondary title. This helps in making the piece of content relevant and contextual to user intent.

This feature is neither available in WordPress nor Genesis by default. So, here’s a nifty WordPress plugin, which enables you to add secondary title to your posts, pages and custom post types — Secondary Title by Kolja Nolte.

Secondary Title is a simple, light-weight plugin that adds an alternative title to posts, pages and/or custom post types which you can display automatically, with a shortcode or by using PHP.

This plugin comes with a rich set of options to make it really simple and easy to add sub-headings / secondary titles / taglines to your posts & pages.

Let’s get started.

Here are 3 simple steps to add secondary title / sub-heading or alternative title to your WordPress post / pages:

Step One: Install and activate the plugin

Install Secondary Title plugin via WordPress dashboard or FTP and activate it. Once you activate the plugin, you will be able to view a text input field below the main title on WordPress page / post edit screen.

enter the secondary title

Step Two: Configure the plugin settings

Once you have activated the plugin, go to Settings > Secondary Title and configure the plugin settings. It allows to define the display settings; both in admin area as well as for website front-end. You can also specify whether you want to make the secondary title searchable.

Here’s a quick overview of the plugin settings:

General Settings: To specify the format for the title with secondary title and whether the secondary title should be automatically inserted with the standard title.

By default plugin automatically displays secondary titles. Turn off “Auto Show” and manually hook the secondary title after Genesis Entry Header. Refer Step Three for manually inserting / adding the secondary title to your Genesis child theme.

General Settings — Secondary Title
General Settings — Secondary Title

Display Rules: To have a finer control on display of secondary title. You can select the post types, categories and specify the post IDs where you want to use the secondary titles. You can update these settings as and when required.

Display Rules — Secondary Title
Display Rules — Secondary Title

Miscellaneous Settings: Here you can specify if you want to make your secondary title searchable, set the position of the input field on post / page edit screen (above or below WP standard title) and where would you like to add the admin column on WordPress posts / pages screen.

Miscellaneous Settings — Secondary Title
Miscellaneous Settings — Secondary Title

Step Three: Add the code to display the secondary title on the website front-end

One of the best features of this plugin is that it allows you to manually output / add the secondary title to your theme. This enables you to have a better control over the style and formatting of the secondary title.

Here’s a code snippet to insert the secondary title to your Genesis child theme. Add the following code to your theme’s functions.php:

/**
 * Adds a secondary title / tagline below singular post title
 * Depends on plugin: https://wordpress.org/plugins/secondary-title/
 *
 * @return void
 */
function bt_secondary_title(){
	if(function_exists('secondary_title_add_shortcode_function') && is_singular()) {
		$post_tagline = get_secondary_title();
		if( $post_tagline ) {
			echo '<h3 class="post-tagline">' . $post_tagline . '</h3>';
		}
	}
}

add_action( 'genesis_entry_header', 'bt_secondary_title', 12 );

Reference: Here’s a quick tutorial on how to edit functions.php in WordPress.

Divi WordPress Theme