Pass parameter for new count?
-
Can I pass a parameter to a like button to have it keep a separate count for an element?
For instance, I use a CPTs that sometimes gets reused in posts. I would like a separate count for each CPT that appears on a new post.
For instance, on the website above, in each issue, each clickable ad (the CPT) has its own Like button. The one with the most likes gets a special designation (red sparkles). The ads that appear in more than one post tend to get the most Likes, and I would like that to be treated separately in each issue.
Is that clear at all?
Here is the code in my CPT template:
<div class="upvote"> <?php echo do_shortcode( '[wp_ulike for="thing" id="' . get_the_ID() . '" style="wpulike-twitter"]'); ?> </div><!-- .upvote -->
So I guess a question that I’m asking is this: Is the id linked to the CPT or is it just an arbitrary id that gets looked up in the ULike database? Does it expect an integer?
Could I change this code to:
<div class="upvote"> <?php echo do_shortcode( '[wp_ulike for="thing" id="' . $issueNum . get_the_ID() . '" style="wpulike-twitter"]'); ?> </div><!-- .upvote -->
- This topic was modified 4 years, 7 months ago by .
- This topic was modified 4 years, 7 months ago by .
The page I need help with: [log in to see the link]
- The topic ‘Pass parameter for new count?’ is closed to new replies.