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.

Using the Custom Hook facility to inject a block immediately after content

  • Hi there. the hook “after_content” displays a block I have created just after some “related posts” plugin.

    I want to inject my block in between the end of my Blog article text an before any plugins (e.g. related posts, social icons etc).

    I’m thinking I can create a custom hook that outputs immediate after’the_article’?

    How does the custom hook system work on Generatepress – how do I create a custom hook? In the functions.php in my Child Theme? And then just reference that custom hook in the Block Elements settings?

  • Hi there,

    A custom hook would not be the solution for this issue.

    The solution for this problem is to insert your plugin content (related posts and social icons) manually using the same hook after_content and then control the order using the hook priority:
    https://docs.generatepress.com/article/hooks-element-overview/#settings

    Let me know if this helps 🙂

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