Archived topic
Add Page Title in Page Header
15 replies · Started by Lynn Leon on November 17, 2016
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?
yes Im adding page header. My question is there some shortcode o code to add page title. Thank you
http://www.elmiamipress.com/sample-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.
Hi Kar,
You can use a GenerateBlocks Headline Block.
You can retrieve the Page/Post title with that through its Dynamic Settings: https://docs.generateblocks.com/article/headline-overview/#dynamic-data
Thanks for the quick reply Fernando. I did a quick test.
https://magic.facetofacegames.com/category/modern/
It just seems to grab the post title of my first post here.
Try adding it through the Dynamic setting in the toolbar. Example: https://share.getcloudapp.com/jkuXxm4O
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?