-
AuthorPosts
-
December 2, 2013 at 1:01 pm #195261
Hi guys,
I would like to add a share plugin to our website. I have tried a few, and they all seem to work with shortcodes. These are working fine on pages and single posts, but the problem is that I use Advanced Layout builder pages with the postslider element (postslider.php) and I have to manually add php code to display the counters / buttons. The php codes to add them look most of the time like this:
do_shortcode( ‘[hupso]’ ); or do_shortcode( ‘[ssba]’ );
I can add this to the $output string in postslider.php like this:
$output .= do_shortcode( ‘[ssba]’ );But the shortcode that is being generated is for the entire page (e.d. the homepage). So I for all posts I get the same buttons and the same counts instead of share buttons for the different posts.
Do you know of a plugin that can be integrated with the “Blog Posts” element so we can achieve something similar to this:
http://www.redlemonclub.comregards, Bas
December 2, 2013 at 8:10 pm #195447Hey thisafternoon!
You can try this plugin http://wordpress.org/plugins/socialize/
Please see list of recommended plugins list here https://kriesi.at/support/topic/recommended-plugins-last-update-04-09-2013/Regards,
YigitDecember 4, 2013 at 12:24 pm #196109Hi Yigit,
Thanks for you reply. I’m willing to use this plugin, but I can’t figure out how the buttons can be added to the content element “blog posts” (postslider.php)
It is appearing in the single posts:
http://www.duizenddodos.nl/startpagina/sociale-media-haat-liefde-relatie/But not in the blog posts on the homepage:
http://www.duizenddodos.nlIs there a way to change the code in postslider.php so the Socialize buttons show up beneath all the blog excerpts on the homepage?
Regards,
Bas
December 6, 2013 at 10:08 am #196940Hey!
As far as I know socialize does not offer a php function to call the social media icons directly within the php code (however please correct me if I’m wrong). However according to this thread: http://wordpress.org/support/topic/short-code-23?replies=2 you can add attributes to the shortcode. You can use the attributes like
do_shortcode('[ssba title="'.$entry->post_title.'" url="'.get_permalink($the_id).'"]');
to customize the output of the social media links for each post in postslider.php
Best regards,
PeterDecember 12, 2013 at 3:27 pm #199498Peter dude,
This is the perfect solution!
Thank you very very much!
grtz, Bas
-
AuthorPosts
- The topic ‘Add share buttons to postslider.php’ is closed to new replies.