[Resolved] Add hook after content and before related posts

Home Forums Support Add hook after content and before related posts

  • This topic has 3 replies, 2 voices, and was last updated 12 months ago by David.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1021775
    Sarah Cairncross

    Hi, I’ve created a hook via Appearance > Elements to display a CTA at the end of every blog post for a client.

    However, she would like it to appear after the content and before the related posts show via the plugin I am using – Related Posts Thumbnails by WPBrigade.

    I have the option to automatically append to the post content or use the following snippet in The Loop <?php get_related_posts_thumbnails(); ?>

    I’m not sure what to do or how to achieve the desired order of content. Can you help please?

    #1021780
    David
    Staff
    Customer Support

    Hi there,

    you can create a second after_content hook and add the php snippet provided by the plugin, making sure you check execute PHP.

    The Priorty number on the Hook Element will change a hooked functions position; 0 (zero) is at the top and larger numbers will move it down the display, so your second hook could be 15 for example

    #1022460
    Sarah Cairncross

    That worked a treat! So simple when you know how 🙂
    Thank you David

    #1022643
    David
    Staff
    Customer Support
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.