Title: Extra parameters in the shortcode?
Last modified: August 30, 2016

---

# Extra parameters in the shortcode?

 *  Resolved [cihat74](https://wordpress.org/support/users/cihat74/)
 * (@cihat74)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/extra-parameters-in-the-shortcode/)
 * Hi,
 * I need to use this plugin in Essential Grid by Themepunch. I managed to apply
   the shortcode into the skin but all elements in the grid are affected at once
   when I click.
 * In a support issue, a guy says he has managed this by writing the shortcode with
   ID of the post as an extra parameter.
 * Is it possible to do that?
 * [https://wordpress.org/plugins/kodex-posts-likes/](https://wordpress.org/plugins/kodex-posts-likes/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Pierre Lebedel](https://wordpress.org/support/users/pierre-lebedel/)
 * (@pierre-lebedel)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/extra-parameters-in-the-shortcode/#post-6734344)
 * Hi!
    Thanks for the review!
 * Actually you can’t do that without modify some PHP code. Maybe in a next release,
   I’ll prepare that.
    But, the shortcode will work if you are in a WP loop. To 
   be sure, during our dev, you can white something like this beside the shortcode
   <?php the_ID(); ?>. If the displayed post ID is ok, the buttons will be ok.
 * I need more time to test the plugin with Essential Grid by Themepunch.
 *  Thread Starter [cihat74](https://wordpress.org/support/users/cihat74/)
 * (@cihat74)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/extra-parameters-in-the-shortcode/#post-6734349)
 * Thanks for fast response. Actually your plugin works perfectly in the normal 
   world. I -a man with no php- just thought there could be an easy way to accomplish
   that.
 * For now I don’t know how to implement this php code.
 * Anyway, I will be waiting with hope.
 *  Plugin Author [Pierre Lebedel](https://wordpress.org/support/users/pierre-lebedel/)
 * (@pierre-lebedel)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/extra-parameters-in-the-shortcode/#post-6734356)
 * You can try this, but if it does not work the first time, I advise you to wait
   for the next release:
 * In the plugin file `public/class-kodex-posts-likes-public.php`, you can replace
   the entire function `shortcode_buttons` by this code:
 *     ```
       public function shortcode_buttons($atts){
       	$a = shortcode_atts(array('postid' => get_the_ID()), $atts);
       	$post_id = $a['postid'];
       	$post_type = get_post_type($post_id);
   
       	$html = '';
       	if(in_array($post_type, $this->get_option('post_types'))){
       		$html .= '<div class="kodex_buttons" style="text-align:'.$this->get_option('alignement').';">';
       		$html .= $this->buttons($post_id);
       		$html .= '</div>';
       	}
       	return $html;
       }
       ```
   
 * After this change, the shortcode could take a `postid` attribute, like this: `[
   kodex_post_like_buttons postid="1234"]`
 *  Thread Starter [cihat74](https://wordpress.org/support/users/cihat74/)
 * (@cihat74)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/extra-parameters-in-the-shortcode/#post-6734363)
 * 🙂 🙂
 * HIP HIP HIP, HOORAY…
 * I bow my head in front of you Pierre. Marvelous – Splendid – Greatest – Fastest
   support almost at no time.
 * Thank you really much.
 * /*** For Those Who Are Looking For The Same Issue ***/
    1- I did the fix above,
   2- Added the shortcode above to the content of the post with the correct ID of
   the post (can be seen in URL box of the browser), 3- In the skin editor of the
   Essential Grid plugin, added a text/html layer and set it as post-content under
   the source tab. /*** End ***/
 * Have a nice life, Pierre.
 *  Plugin Author [Pierre Lebedel](https://wordpress.org/support/users/pierre-lebedel/)
 * (@pierre-lebedel)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/extra-parameters-in-the-shortcode/#post-6734405)
 * Hi. The changes I have made you make are now integrated in the plugin Version
   2.2.
 *  Thread Starter [cihat74](https://wordpress.org/support/users/cihat74/)
 * (@cihat74)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/extra-parameters-in-the-shortcode/#post-6734454)
 * Great.
 * By the way, I’d like you to keep in mind that I can help in Turkish localisation
   not this plugin but in any of your other projects if you need.
 *  [redworker](https://wordpress.org/support/users/redworker/)
 * (@redworker)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/extra-parameters-in-the-shortcode/#post-6734561)
 * Hello Pierre,
 * I used your plugin for my site. It works well. Good job on this little jewel!
   
   Now I wonder if I can give my users a freedom to vote once per day. As of now
   plugin allows to vote only once.
 * Thank you!
 *  Plugin Author [Pierre Lebedel](https://wordpress.org/support/users/pierre-lebedel/)
 * (@pierre-lebedel)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/extra-parameters-in-the-shortcode/#post-6734675)
 * Hi [@redworker](https://wordpress.org/support/users/redworker/).
    Actually, this
   plugin conception does not allow single user vote per day, and I think it will
   never be the case, unfortunatelly. Thank you to use this plugin anyway

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Extra parameters in the shortcode?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/kodex-posts-likes_2497a0.svg)
 * [Kodex Posts likes](https://wordpress.org/plugins/kodex-posts-likes/)
 * [Support Threads](https://wordpress.org/support/plugin/kodex-posts-likes/)
 * [Active Topics](https://wordpress.org/support/plugin/kodex-posts-likes/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/kodex-posts-likes/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/kodex-posts-likes/reviews/)

## Tags

 * [parameter](https://wordpress.org/support/topic-tag/parameter/)

 * 8 replies
 * 3 participants
 * Last reply from: [Pierre Lebedel](https://wordpress.org/support/users/pierre-lebedel/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/extra-parameters-in-the-shortcode/#post-6734675)
 * Status: resolved