[Support request] Page Header Template Tag Inside a ShortCode

Home Forums Support [Support request] Page Header Template Tag Inside a ShortCode

Home Forums Support Page Header Template Tag Inside a ShortCode

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #528213
    Dev

    I have written a custom shortcode which outputs the following HTML. When expanding the shortcode, GP is not expanding the template tags inside the HTML. So the rendered text does not include the full post title (or any other template tags).
    Is this by design or is there is a work around it?

    <header class=”entry-header custom-entry-header”>

    <h1 class=”entry-title” itemprop=”headline”> {{post_title}}</h1>

    </header>

    GeneratePress 2.0.2
    #528793
    Tom
    Lead Developer
    Lead Developer

    Template tags won’t work inside shortcodes. The Page Header searches the content before shortcodes are rendered.

    Instead, your shortcode can use the_title() function using PHP.

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