Using the shortcode in a page or post

There is a short code available called [share_links], it can be placed into any post or page in the Visual or HTML tab.

Basic version

[share_links]

Which can be placed anywhere in a post or page. It shows as standard links to Facebook, stumble upon, orkut, digg, reddit, delicious, twitter and myspace without the words ‘share’ as the first list item and using icons of 16X16px and showing text.
here are the defaults presented as an array.


     shortcode = array (     'list_style' => "icon_text",
                                    'direction' => 'down',
                                    'share'=>'no',
                                    'facebook'=>'yes',
                                    'stumble'=>'yes',
                                    'hyves'=>'no',
                                    'orkut'=>'yes',
                                    'digg'=>'yes',
                                    'reddit'=>'yes',
                                    'delicious'=>'yes',
                                    'twitter'=>'yes',
                                    'myspace'=>'yes',
                                    'mixx'=>'no',
                                    'email'=>'no',
                                    'post_rss'=>'yes',

);

It can be used in the full version of

[share_links facebook="yes" twitter="yes" hyves="yes" stumble="yes" twitter="yes" delicious="yes" digg="yes" reddit="yes" orkut="yes" myspace="yes" post_rss="yes" mixx="yes" email="yes"  share="yes" direction="row" size="24" list_style="iconOnly"]
  • Change the word yes to no to make it not display that link or word (share)
  • Changed the direction from down to row to change the way it displays on screen, or
  • Change list_style to text, icon_text or iconOnly
  • Change the size to any of the following 16, 24, 32, 48, 60

It can also be used in this format

[share_links]
<div style="float: right; width: 200px;">
<h4>share this post</h4>
[/share_links]
</div>

This means that the content between the [share_links][/share_links] will be displayed with the share links themselves. The share links are placed where the [/share_links] is located.

31 Responses to Using the shortcode in a page or post

  1. Php coder says:

    You wrote:
    share_links facebook=”yes” twitter=”yes” hyves=”yes” stumble=”yes” twitter=”yes” delicious=”yes” digg=”yes” reddit=”yes” orkut=”yes” myspace=”yes” post_rss=”yes” mixx=”yes” email=”yes” share=”yes” direction=”row” size=”24″ style=”iconOnly”]
    But … style=”iconOnly”… doesn’t work? because you didn’t add this parameter in your function share_func($atts, $content). I’ve fixed it for myself and it worked.

    • Hey Php Coder,
      Yep your right. I was tempted to do a release yesterday to fix this but as it was such a small change I left it till today when I have much more to add. You will find that it is fixed in the next release. I found it yesterday morning while putting my own plugin onto a new site. Was a little embarrassed but was quick to fix like you found.

      All the best
      Andy

  2. BCfan says:

    First off, I love your addon, thanks for everything you’ve done. But is there a reason why google buzz isnt included in this medthod or the “implementing into a theme” medthod?

  3. BCfan says:

    Nevermind, the argument names are the same as the png file names. Thanks again for a great product. Oh, and I should probably put this somewhere else, but the email mousover (title) says “Follow this this blog”, and ‘email_share_text’ doesnt fix it, and neither does changing the options in the settings.

  4. I’m using vers. 1.19.5, and share_links style=”iconOnly” still doesn’t seem to be working. I’m not experienced with PHP, so not sure how to fix it?

  5. Greg says:

    Do I need to download the plugin, or can I just copy the large block code above and paste it into the html editor on wordpress?

    Thanks.

  6. Greg says:

    I’ve gotten this to work on my page, but it looks like the facebook link results in a bunch of code as opposed to a link or a blog posting.

    Also, as others mentioned, the iconOnly isn’t working properly, but I’m sure you’re looking into that!

    Thanks again.

    Great stuff.

  7. Greg says:

    I installed the plugin. Everything seems to be working instead of facebook. When I tried to share on facebook or even manually cut and paste my blog URL to facebook it pulls in a generic gravatar and code (as opposed to a thumbnail image from my blog and a sample of text).

    When I removed the plugin, the problem remained. Argh!

    Please help.

    Thanks,
    Greg

    • Greg

      try setting up your web pages properly. Setup both Title and Description in the HEAD and facebook will use that. facebook had changed slightly where it take an image first from the site and then 2nd a share url image. this is facebooks choice. Also facebook chooses to cache images so if you multi share the same page you’ll get the same image.
      regards
      Andy

  8. Greg says:

    Thanks Andy – I’ll pass this along to the developer that’s helping me. I’m not a developer, so it’s hard for me to follow unless you break it down very simply. Haha.

    I’ll let you know what he says.

    Greg

  9. Nick says:

    Hey there,

    Just installed this plugin. Pretty awesome. Question though: is the iconOnly style issue still an issue? I can’t seem to get it to work, and I’m not sure if it’s just me… I checked the change log and didn’t see any reference to it being fixed yet and the last comment on here about it is dated over two months ago.

    Anyways, if you could let me know, I’d appreciate it. :)

    • Nick

      Are you getting problems with the shortcode or the social_links function? btw: if you use my_social_links(); it will do whatever settings you have in the admin panel.

      regards
      Andy

  10. Joy says:

    The error mentioned by Php coder back in June is subtly still there because this page documents the example using the keyword “style=iconOnly” instead of what is in the code, which is list_style.

    Also, the list above showing the defaults does not comprise all of the defaults, and only those listed are passed on to the shortcode (all others are ignored). So the rest of the parameters to the social_links function get set to that function’s default value.

  11. Man the IconOnly in the short code is still not working even in the new release?!

  12. Ron says:

    Whats the shorcode for including the “Facebook LIKE button and TWEET button” ?

    • andy killen says:

      Hey Ron,

      I have not created the shortcode for that yet. I will do it soon

      regards
      Andy

      • Harl Van Deursen says:

        I’m interested in a shortcode for interactive share buttons (Like and Tweet) as well. In particular, my plan is to display both the regular share buttons and the interactive share buttons on a single row, with the row of regular shares left-aligned and the row of interactives right-aligned. This will display more nicely and discreetly in a block-style blog where most text is fully justified.

        Honestly, I would be even happier if I could do this in the Share and Follow settings so that they’re automatically inserted (I would be willing to give up the left-and-right blocks), but this level of automatic formatting may be asking too much. Or is it? Could you provide the option to include them all in the same visual “block” within the post body? Like maybe expand the positioning options for the interactive buttons (topleft, topright, bottom) to include (withsharelinks)?

        Oh, and one more thing: it would be nice if you included an ID or a class for the interactive share buttons like you do for the regular shares (class=shareinpost in that case). This would allow for things like easily suppressing during print (which I’m now fudging by suppressing all iframe tags) and maybe other alignment tweaks.

        All that being said, let me say this: I’m migrating a blog to WordPress for a client who is extremely visually particular. I did some checking around on social networking plugins, and Share and Follow looked like the right choice. So far, so good. I really appreciate everything you have included so far. Now if you would just put my own selfish individual needs at the head of your queue, wouldn’t that be great?

  13. Jolie says:

    When using the short link:
    [share_links facebook="yes" twitter="yes" hyves="yes" stumble="yes" twitter="yes" delicious="yes" digg="yes" reddit="yes" orkut="yes" myspace="yes" post_rss="yes" mixx="yes" email="yes" direction="row" size="16" list_style="iconOnly"]

    I’ve noticed that the icons have a black dot in between / overlapping on the icons. Is there a way to remove this dot? I’ve looked at the php file and can’t seem to find it. The page I’m referencing is: http://nutraeasy.com/wholefoodtherapy/testimonials/

    Thanks,
    Jolie

  14. Karla says:

    Hi, I was wondering how I can integrate a URL shortening to the Twitter Share and if I could make it “via @whiteboxstudio”, because it doesn’t automatically do so.

    • andy killen says:

      there are 2 seperate occasion where you can enter the via @whiteboxstudio

      for the interactive button enter the details at “Via setting, enter your twitter name (optional)” twitter automatically shortens urls
      for the standard share button enter the details at “Tweet Suffix what it says after the tweet”, for Bit.ly URL shortening you will need to have a bitly account and also have php V5 installed on the server.

      Please in future use the support forum so that every one can make benefit from your questions rather than choosing a random page to make a comment on. http://share-and-follow.com/support/forum

  15. Matthew says:

    Hi,
    I’d like to use the Facebook “Like” and Twitter “Tweet” buttons on my main page, but I need the short code for this, do you by chance have one? Thank You! Great work btw!

  16. James says:

    hi,

    great plugin.
    do you have any plans to add option of one share button/icon with pop-up (or how it is called) and/with selection of all existing buttons, like almost all other social plugins have, or maybe it already exists?
    Don’t know how to explain – one icon, but after it is pressed you see all share buttons.
    You have great “Follow us” option, but this small absence of share icon create thoughts of using other plugin, as it is easier and better for design to have one icon.

    thanks a lot!

    • andy killen says:

      It has not been my plan to add this funciton in the short term as it relies on Javascript and I wanted to stay away from that so that it makes it work everywhere.

      use what ever plugins you like.