Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #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.com

    regards, Bas

    #195447

    Hey 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,
    Yigit

    #196109

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

    Is 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

    #196940

    Hey!

    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,
    Peter

    #199498

    Peter dude,

    This is the perfect solution!

    Thank you very very much!

    grtz, Bas

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Add share buttons to postslider.php’ is closed to new replies.