WordPress Different Page Title to Navigation in Thesis

There are already several tutorials that show how to create WordPress different page title in menu but for not specifically for Thesis. I struggled for a time because I couldn’t get the custom fields to display using the normal method shown in the WordPress Codex.



I accidentally got it too work with the help of advanced custom fields plugin. Follow these steps:

1. Download and install Advanced Custom Fields

2. Add this code snippet in your custom_functions.php:

//Hide title
function hide_post_title() {
	if(get_field('long_title') && is_single())
		return false; // Do not show headline
		return true; // Show headline
add_filter('thesis_show_headline_area', 'hide_post_title');

// Long Title
function show_long_title() { ?></pre>
<div class="headline_area"><!--?php <br ?--> if(function_exists('get_field')){
 if(get_field('long_title') && is_single()) {
 echo '
<h1>' . get_field('long_title') . '</h1>
} ?></div>
<!--?php }<br ?-->add_action('thesis_hook_post_box_top','show_long_title');

3. Add a custom field name ‘long_title’ and enter whatever you want for your long title.

When you see a different title for your page and navigation then you have done it correctly. I have it setup on this post right now.

Reply below for questions. Share this if you found it useful.

Like, Tweet and Share!

Comments are closed.
Published Last updated