• Resolved hootan7

    (@hootan7)


    Hi!

    Im trying to show multiple HeartThis on one page so people can vote by heart:ing the item they like most.
    Does anyone know how I can achieve that?

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m also looking for help regarding this same issue. I’ve tried adding each of the codes below to my custom page template and heartthis appears for each ‘blog’ post, however, only the first post appears to cache / save accurate results.

    Clicking hearthis on any of the subsequent post will result in all of the posts receiving a ‘+1’ heart or even sometimes a ‘-1’ heart (except for the first post). I’ve tried other ‘heart’ plugins but liked this one the best and would love to be able to implement it in my new site.

    1. <?php heart_this_hearts(); ?>
    2. <?php if ( function_exists( 'heart_this_hearts' ) ) { heart_this_hearts(); } ?>

    If the developer could at least follow up and let us know if this is possible or not with this plugin that would be amazing.

    My post template is below if that helps (Note: I removed a lot of comments from this snippet):

    <?php
     * Template Name: Images
    get_header(); ?>
    <!--<div class="wrap">-->
        <div id="primary" class="content-area">
            <!--<main id="main" class="site-main" id="main" role="main">-->
                <?php
    	       while ( have_posts() ) : the_post();
                    get_template_part( 'template-parts/page/content', 'page' );
    		if ( comments_open() || get_comments_number() ) :
                         comments_template();
    	        endif;
    		endwhile;?>
    
                <!--Main Content-->
                <?php if ( have_posts() ) : ?>
                <?php while ( have_posts() ) : the_post(); ?>
                <?php get_template_part( 'content', 'page' ); ?>
                <?php endwhile; ?>
                
                <?php endif; wp_reset_postdata(); ?>
                <?php $images = new WP_Query(array(
                'post_type' => 'images'
        )); ?>
    
                    <?php while($images->have_posts()) : $images->the_post(); ?>
    
                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 img-responsive" id="postImg" style="">
    
                   <?php the_post_thumbnail('full'); ?>
                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" id="postText" style="">
    
                        <div style="">
                        <p class="title" style="font-size:28px; font-weight:100;">
                            <?php the_title(); ?>
                        </p>
                        <p class="artist" style="font-size:14px;margin-top:-10px;font-weight:100;">
                            <?php the_field('artist'); ?>
                        </p>
                        <p class="contact" style="font-size:10px;margin-top:-15px;font-weight:100;">
                            - <a id="userLink" href="http://www.<?php the_field('contact'); ?>"<a><?php the_field('contact'); ?></a>
                        </p>
                        <p class="caption" style="font-size:12px;margin-top:15px;font-weight:100;width:350px;overflow:hidden; max-height:135px;">
                            <?php the_field('caption'); ?>
                        </p>
                        <p class="btn-group">
                            <button class="btn btn-sm btn-outline-primary" href="" style="margin-right:0px;">Read<?php the_post('post');?></button>
                            <button id="download" class="btn btn-sm btn-outline-primary">use</button>
                            <?php heart_this_hearts(); ?>
                            <?php if ( function_exists( 'heart_this_hearts' ) ) { heart_this_hearts(); } ?>
                        </p>
                        </div>
       </div>
    </div>
    </div>
    <?php endwhile; ?>
    </main>
    </div>
    </div>
    <?php get_footer();
    • This reply was modified 6 years, 10 months ago by JerrySeinfeld.
    Plugin Contributor SiteCare

    (@wpsitecare)

    Hey There,

    Because of the way the plugin works (setting cookies), multiple hearts per page wouldn’t be possible to implement. If you’re looking for a voting solution of some kind, unfortunately this plugin wasn’t built for that purpose. Good luck!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multiple HeartThis on one page’ is closed to new replies.