Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Adding Elements to a page

  • Hello, I am a total beginner, but I am loving GP and GB so far.

    I have created an element for “our services” which essentially is one of the provided gb patterns. I understand how to make it appear on every page (or specific pages) and even on the hooks on different parts of the page. But this always appears on the same place (before the footer in this case).

    My question is: for a specific page, If I would like the element i created to appear in the middle of a page instead of the before the footer hook, how can i do this using the same element? (id like it to be the same element so that when i update it, it updates in every instance where the element was used.

    I hope this makes sense.
    thank you.
    Richard

  • Hi there,

    thanks for the kind feedback.

    To cover, your post content doesn’t contain any action hooks to hook into.
    Those hooks are reserved for code, such as a theme template.

    But you can use a PHP Snippet to filter the content and inject a buffered Hook inside there.

    See my reply here on how to do that:

    https://generate.support/topic/create-a-small-banner/#post-91032

    The example injects after the 3rd Paragraph on the post.
    On this line: return prefix_insert_after_paragraph( $inserted_hook, 3, $content ); you can change the 3 to a different paragraph number.

  • Hi David,
    Thank you very much for getting back to me, and so fast. I tried a few things but was unable to get it to work. however after a bit more searching i found this post.

    https://generatepress.com/forums/topic/hook/#post-1036765

    I was able to create the shortcode, add the snippet, and insert it into my content where i wanted.
    Thank you very much for your time and patience :).

    Richard

  • Glad to hear you got it working!!

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