• Resolved cihat74

    (@cihat74)


    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://www.ads-software.com/plugins/kodex-posts-likes/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Pierre Lebedel

    (@pierre-lebedel)

    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

    (@cihat74)

    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

    (@pierre-lebedel)

    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

    (@cihat74)

    ?? ??

    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

    (@pierre-lebedel)

    Hi. The changes I have made you make are now integrated in the plugin Version 2.2.

    Thread Starter cihat74

    (@cihat74)

    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.

    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

    (@pierre-lebedel)

    Hi @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.