Title: Pass parameter for new count?
Last modified: April 28, 2020

---

# Pass parameter for new count?

 *  [Wes Modes](https://wordpress.org/support/users/wmodes/)
 * (@wmodes)
 * [6 years ago](https://wordpress.org/support/topic/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 6 years ago by [Wes Modes](https://wordpress.org/support/users/wmodes/).
    -  This topic was modified 6 years ago by [Wes Modes](https://wordpress.org/support/users/wmodes/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fpass-parameter-for-new-count%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Thread Starter [Wes Modes](https://wordpress.org/support/users/wmodes/)
 * (@wmodes)
 * [6 years ago](https://wordpress.org/support/topic/pass-parameter-for-new-count/#post-12741252)
 * After a test, it looks like the count is associated with an arbitrary id. So 
   yes, it appears that I can add an arbitrary number before or after the id and
   still have it work.
 * Now, if I can only figure out how to get the id of the outer post that my CPT
   is inserted into.

Viewing 1 replies (of 1 total)

The topic ‘Pass parameter for new count?’ is closed to new replies.

 * ![](https://ps.w.org/wp-ulike/assets/icon.svg?rev=2453069)
 * [WP ULike – Like & Dislike Buttons for Engagement and Feedback](https://wordpress.org/plugins/wp-ulike/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-ulike/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-ulike/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-ulike/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-ulike/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-ulike/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [Wes Modes](https://wordpress.org/support/users/wmodes/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/pass-parameter-for-new-count/#post-12741252)
 * Status: not resolved