Site logo

[Resolved] Add Page Title in Page Header

Home Forums Support [Resolved] Add Page Title in Page Header

Home Forums Support Add Page Title in Page Header

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #245153
    Lynn Leon

    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

    #245211
    Tom
    Lead Developer
    Lead Developer

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

    #245309
    Lynn Leon

    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/

    #245321
    Tom
    Lead Developer
    Lead Developer

    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]

    #245340
    Lynn Leon

    Thank you Tomy.
    Lyn Leon

    #245429
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

    #2060194
    Adam

    Geez, why not for title just implement a simple shortcode

    #2060345
    David
    Staff
    Customer Support

    Hi there,

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

    #2309527
    Kar Yung

    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.

    #2309530
    Fernando
    Customer Support

    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

    #2309539
    Kar Yung

    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.

    #2309549
    Fernando
    Customer Support

    Try adding it through the Dynamic setting in the toolbar. Example: https://share.getcloudapp.com/jkuXxm4O

    #2309576
    Kar Yung

    Wrong link? Example refers to this page.

    #2309579
    Fernando
    Customer Support

    Sorry about that. I corrected it now.

    #2309582
    Kar Yung

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

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.