Site logo

Archived topic

Add Page Title in Page Header

15 replies · Started by Lynn Leon on November 17, 2016

Viewing posts 1–15 of 16

I would like to add a page title in a page Header dynamically. I'm not an expert. Can somebody help me?
Thank you
Lyn

How are you adding the page header? Manually on each page?

You could create a shortcode which will output the page title:

add_shortcode( 'page_title','tu_page_title_shortcode' );
function tu_page_title_shortcode()
{
    return get_the_title();
}

Then you could use it as:

[page_title]

Thank you Tomy.
Lyn Leon

You're welcome :)

Geez, why not for title just implement a simple shortcode

Hi there,

the latest version of WP provides a Post Title Block.... a lot has changed since this 5 year old topic :)

Hey David,

That's still not the same as Page Title right? What's the best current way to be able to style a page title of a category archive page? I would like to be able to add it inside of a container if possible.

Wrong link? Example refers to this page.

Sorry about that. I corrected it now.

Can confirm it works but now I want to at least understand why for future use?

This archived topic is closed to new replies.