• surferbloggy

    (@surferbloggy)


    Hi! I’m learning writing plugins: if I want to add “hello” every posts at the end of content before comments: which code I need:

    I tried:add_filter('the_content','my_plugin_function');

    but it replace the content of post with ‘hello’, which action or filter I have to add to place it after each post?? thanks if you help me

    plugin_activate()
    function plugin_activate()
    {
    
    	add_filter('the_content','my_plugin_function');
    
    }
    
    function my_plugin_function() {
    
    	$out = 'hello';
    	$out = apply_filters('write_content', $out, $arg);
            return $out;
    }

  • The topic ‘[writing a plugin] place a text after posts before comments’ is closed to new replies.