I have an issue with sending an e-mail on address with the link with disliked post. So, when a guest click on "Dislike" button, link of the post must be submitted to a given e-mail address.

My blog_likes.php file looks like this:


$likes = 0; $dislikes = 0;

if (get_field('post_score_likes')) { $likes = get_field('post_score_likes'); }

if (get_field('post_score_dislikes')) { $dislikes = get_field('post_score_dislikes'); }


<section class="blog-likes" data-id="<?php echo get_the_ID() ?>">

<div class="blog-likes__title">Did you find this post helpful and interesting?</div>

<div class="blog-likes__buttons">
<button type="button" class="blog-likes__button like">
  <?php echo get_template_part('partials/icons/icon-dislike') ?>
  <span><?php echo $likes; ?></span>
<button type="button" class="blog-likes__button dislike">
  <?php echo get_template_part('partials/icons/icon-dislike') ?>
  <span><?php echo $dislikes; ?></span>


Please help me to solve this problem. Website is done in Wordpress.

Thank you in advance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.