how to add thank you message after comments wordpress

Sponsors

Many times we got requirement to add thank you message after adding comments added by users.

In this article I will show how to add custom message after getting comments from users. For this we going use the wordpress api. WordPress filters are very useful. You can find all wordpress hooks and filters in wp-includes/default-filters.php file.

Open your functions.php file from your active wordpress theme folder. copy paste the following code in that file.

</p>
<p>function add_custom_text($content) {</p>
<p>    return "</p>
<div class=\"custom-text\">
<p>Hello User!</p>
<p>Thank you for your comment.</p>
<p>Wordpressapi</p>
</div>
<p>";</p>
<p>}</p>
<p>add_filter('comment_text', 'add_custom_text', 1000);</p>
<p>

Incoming search terms:

You may like following Articles!

22 thoughts on “how to add thank you message after comments wordpress

  1. Pingback: Como adicionar uma mensagem de agradecimento após um comentários no wordpress | Ajuda Wordpress em Português

  2. Очень интересно, но все в будущем хотелось бы еще побольше узнать об этом. Очень понравилась ваша статья!

  3. Блоггер, дилема растолкованная вами на блоге несомненно жизненна. Я думаю что тема стоит продолжения в приватной дискуссии. Кстате, у блога непонятное с код-кой RSS. ;)

  4. Pingback: Como adicionar uma mensagem de agredecimento após um comentário no WordPress | Ajuda WordPress - Plugins WordPress, Temas WordPress e Dicas

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>