Forums

Page TItle Changer? (2 posts)

  1. Mufasa
    Member
    Posted 4 years ago #

    Say I make a page called "Shop". When I goto that page the heading is of course "Shop" and the link in the nav is also "Shop". Great.

    But is there a plugin that can change the heading and not the link. I want the heading to be something powerful like "Start selling online today..."

    "Start selling online today..." Is not such a good link to have in your nav bar :P

  2. Kafkaesqui
    Moderator
    Posted 4 years ago #

    (This is one of those times where I wish WordPress had a description field in the post editor...)

    Custom fields to the rescue!

    Step 1: Add a custom field key to your Page called 'description' with "Start selling online today..." as its value.

    Step 2: Somewhere before the <title> in your header, add this:

    <?php global $post; $title = get_post_custom_values('description', $post->ID); $title = (!empty($title[0])) ? $title[0] : wp_title('', false); ?>

    Then change the <?php wp_title(); ?> in your <title> tag to:

    <?php echo $title; ?>

    Note: If you use a separator wp_title(), make sure to change the blank one in the code above.

Topic Closed

This topic has been closed to new replies.

About this Topic