Support » Plugin: AMP for WP - Accelerated Mobile Pages » Action Hooks for Related Posts

  • We are trying to add in some custom content into Design 3 using the functions file. We saw all the hooks, but we couldn’t find any hooks that controlled the display of the Related Posts feature that shows up under the posts. How is this section generated? Where is it in the code? We saw no reference to it in the theme single.php or content.php What hook can use to add custom content both before and after, so we don’t have to edit the related-posts.php file? thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey @osseonews

    Thank you so much for using AMP for WP.

    We are going to write a detailed guide on Hooks. We are a small team of developers who are currently working on this. Our lead developer facing some health issues at the moment.

    In few days we will publish a detailed guide on hooks in https://ampforwp.com/help

    I really appreciate your patience

    [ Signature moderated ]

    Thanks. Just so you now what we ended up doing is adding our own action to the elements/related-posts.php file. We added: do_action(‘ampforwp_post_before_related_posts’

    We did this because seemingly alot of your content/elements in the actual post is controlled by just one filter: ampforwp_design_elements, which makes it very difficult to customize. I suggest adding more action hooks to each of the elements/*.php files. This will make it easier to add stuff via via the functions.php file, instead of modifying the plugin files. thanks.

    Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    Hey @osseonews

    Yes, we are planning to add proper hooks and filters across the plugin.

    You are free to contribute to this project by sending a pull request: https://github.com/ahmedkaludi/accelerated-mobile-pages/pulls

    We will really appreciate your contribution.

    Regards,
    Ahmed

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Action Hooks for Related Posts’ is closed to new replies.