Forums

Plugin development help (3 posts)

  1. MAzCastro
    Member
    Posted 2 years ago #

    Hi

    I need help. This is not about a problem is more like a push up start.

    lets say I want to build a plug-in to add a button to the end of every post (eg. a retwitt button) what should i target to do it?

    I've read a lot about it, but I really couldn't figure out how to target the bottom of a post.

    For now I’ve managed to do it by using a filter and hooking it to the "comments template"

    add_filter('comments_template' , 'myFunction');

    But since not all the themes have this "comments template" so my plug-in will never be "universal" .

    What should be the correct way to do it? can someone give me a clue please?

    Thanks!

    MAC :)

  2. s_ha_dum (was apljdi)
    Member
    Posted 2 years ago #

    Hook to 'the_content'

    function add_after_content($content) {
      return $content.'mybutton';
    }
    add_filter('the_content', add_after_content);
  3. MAzCastro
    Member
    Posted 2 years ago #

    apljdi So simple, so perfect!

    One word: Thanks!

    MAC :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.