[Support request] Dynamic Content in Block Element

Home Forums Support [Support request] Dynamic Content in Block Element

Home Forums Support Dynamic Content in Block Element

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1541708
    Matt

    Hi,

    I have created a custom pre-footer with the Blocks element and used the generate_before_footer hook to register it above the main footer. I have a couple of shortcodes in my child functions.php to display content per page from the default wp metaboxes.

    The shortcodes are able to fetch the correct content, but it is not being rendered within the container that is calling the shortcodes.

    The shortcode markup looks like this “Item No.: [footer_code] Date of preparation: [footer_date]” and the code is being rendered in between the body content and my custom pre-footer like this:

    <div id="page" class="site grid-container container hfeed">
    CODE-0123456October 2020
    <div class="gb-container gb-container-9ae5c626"><div class="gb-inside-container"> <- This i my custom pre-footer element

    Any ideas? Thanks

    #1541943
    David
    Staff
    Customer Support

    Hi there,

    that will be related to how the Shortcodes are outputting their content.
    Are the shortcodes a custom function ? If so – check the example here:

    https://docs.generatepress.com/article/creating-a-shortcode/

    This uses Output buffering which will return the content to the buffer before outputting it to the page which will keep it in place.

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