[Resolved] Post Title Not Appearing When Using Page Hero

Home Forums Support Post Title Not Appearing When Using Page Hero

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1360846
    Jennifer

    Hello,

    I have added my own custom breadcrumbs.

    /**breadcrumb short code USED THIS FOR BREADCRUMBS, IT RETURENED THE TITLE OF THE PAGE*/
    function post_title_shortcode(){
        return get_the_title();
    }
    add_shortcode('post_title','post_title_shortcode');

    It works great on all posts except for the posts where I have enabled a page hero. You moved the title from the content page to the page hero section.
    https://livinghisword.org/truth-being-unveiled-by-a-virologist-on-covid-19-who-was-there/
    <div class="MyBreadcrumbs" typeof="BreadcrumbList" vocab="https://schema.org/"><div><a href="https://livinghisword.org/" aria-label="breadcrumb home page">Home</a> / <a href="https://livinghisword.org/daily-biblical-news/" aria-label="breadcrumb daily biblical news home page"> Daily Biblical News</a> / <span aria-current="page">[post_title]</span> </div></div>

    For some reason this code is not picking up the post title.

    Any ideas on how to fix this?

    Here is a page where I am using the same custom breadcrumb and it works great.
    https://livinghisword.org/what-life-are-you-exemplifying-light-or-darkness-1-john-15/
    <div class="MyBreadcrumbs" typeof="BreadcrumbList" vocab="https://schema.org/"><div><a href="https://livinghisword.org/" aria-label="breadcrumb home page">Home</a> / <a href="https://livinghisword.org/bible-teachings/" aria-label="breadcrumb bible teaching home page">Bible Teachings</a> / <span aria-current="page">[post_title]</span> </div></div>

    Thank you Jennifer

    Jennifer
    Living His Word Ministries, Inc.
    www.livinghisword.org

    #1361116
    Jennifer

    Okay I turned off the page header and still having the same problem.

    Going to trouble shoot this.

    Jennifer
    Living His Word Ministries, Inc.
    www.livinghisword.org

    #1361124
    Jennifer

    I am sorry it has been a long week.

    I did not check the activate short code box.

    This is resolved.

    Again, sorry 🙂

    Jennifer
    Living His Word Ministries, Inc.
    www.livinghisword.org

    #1361193
    Leo
    Staff
    Customer Support

    Hi there,

    Glad you’ve figured out.

    You can actually use the template tag if you are using the page hero:
    https://docs.generatepress.com/article/header-element-template-tags/#post_title

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