• Hello,
    I would like create a plugin to add a vote button (digg-like vote button) in blog without users must modify template files. I have read doc on hooks for wordpress, the solution is perhaps…
    Do you think this is possible?
    Thanks for your help !

    Micka

Viewing 3 replies - 1 through 3 (of 3 total)
  • Yes, with hooks.

    Add this anywhere that is called by every blog page (i.e., header.php, any of your active plugins, or as a new plugin). Then experiment with it.

    function add_a_button($content) {
    	return $content + 'Button goes here';
    }
    
    add_filter('the_excerpt','add_a_button');
    add_filter('the_content','add_a_button');
    add_filter('the_content_rss','add_a_button');

    The complete hook API is at http://codex.wordpress.org/Plugin_API/Filter_Reference .

    If this helps, I invite you to visit my profile page.

    Thread Starter mickagros

    (@mickagros)

    Thanks very much for your help.
    Your code is ok but when I use it, there are only buttons into articles and the content isn’t displayed. Can you tell me how to keep the content of these articles and put buttons at the bottom of articles.

    Thanks!

    return $content + 'Button goes here'; does what you want. Were you experimenting?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘plugin Digg-like vote button without modification in template’ is closed to new replies.