WordPress.org

Ready to get started?Download WordPress

Forums

Sociable
Shortcode not working (13 posts)

  1. manoucho
    Member
    Posted 2 years ago #

    Hi there

    When I try to use the shortcode of sociable in a post, it doesn´t work, instead it displays the shortcode...

    I have read everything I could find about it:
    I use this code: `[sociable] content goes here [/sociable]

    I make sure that it is not in a paragraph

    I also tried to desactivate all the other plugins for a potential conflict...

    But it still doesn´t work. Currrently I am using the automatic mode on my website (emmanueltenenbaum.com) but it doesn´t give me the flexibility I want...

    Any idea??
    Thanks a lot in advance!
    Manu

    http://wordpress.org/extend/plugins/sociable/

  2. sociable
    Member
    Plugin Contributor

    Posted 2 years ago #

    Hi manoucho, try this...

    <?php if( function_exists( do_sociable() ) ){ do_sociable(); }

    Please tell us how it works in your site.

  3. manoucho
    Member
    Posted 2 years ago #

    Hi!

    Thanks a lot for y our answer!

    Just to be sure, can you tell me where I should add this code? header.php ?

    Thanks!
    Manu

  4. sociable
    Member
    Plugin Contributor

    Posted 2 years ago #

    manoucho add code in the place that you want to appear.

  5. frankv001
    Member
    Posted 2 years ago #

    I have the same problem as Manoucho. Your answer doesn't makes too much sense to me. s far as I understand, you can add the shortcode in the visual editor, or you add the php code mensioned above in the html part, but then the code disappears?
    Manoucho is correct that this code belongs in a php file.
    Please elaborate! Thanks.
    PS: I just checked your code. It is not complete.it should be
    <?php if( function_exists( do_sociable() ) ){ do_sociable(); } ?>

    But this doesn't help us to add the icons to a wordpress page or post.

  6. incunix
    Member
    Posted 2 years ago #

    Fixed this by doing a simple tweak. Seems as though he didn't register the shortcode in his code...

    Under the line add_filter( 'the_excerpt', 'auto_sociable' ); in the sociable.php file (found under wp-content/plugins/sociable/), put this line:

    add_shortcode( 'sociable', 'sociable_shortcode' );

    Shortcodes should work like a dream now :)

  7. jcmoyon
    Member
    Posted 2 years ago #

    Hi,
    I have used the following line in my page : < ?php if (function_exists('sociable_html')) {echo sociable_html();} ?>

    and have added : add_shortcode( 'sociable', 'sociable_shortcode' );
    in the sociable.php file as mentioned

    but nothing happens, or more precisely it is the line of code that appears and not the symbols.

    Can you help ?

    By the way, the Email button is linked to Google. How can one include a button that links directly to the visitor's email ?

    Thanks,
    Jean-Claude

  8. MartaVictoria
    Member
    Posted 2 years ago #

    Dear Incunix;

    Nice. That code solved my (same) problem using this shortcode:

    [sociable/]

    I'd like to kill the borders above and below the icons, and right-align them. Suggest any code for that? (I'd be appreciative). Site currently self-hosted (so no link).

    Thanks if you can,

    Marta

    http://www.martavictoria.com

  9. jcmoyon
    Member
    Posted 2 years ago #

    @MartaVictoria

    Nice site you've got.

    What do you mean by "That code solved my (same) problem using this shortcode:

    [sociable/]"

    How did you go about it ?

    Jean-Claude (in the process of merging site+blog under WP) - present site http://www.atlantique-photo.com

  10. MartaVictoria
    Member
    Posted 2 years ago #

    Thanks.

    I followed Incunix's directions to add code to the php file:

    Under the line add_filter( 'the_excerpt', 'auto_sociable' ); in the sociable.php file (found under wp-content/plugins/sociable/), put this line:

    add_shortcode( 'sociable', 'sociable_shortcode' );

    To do that, I made a back-up copy of the php file first (as a safety) before editing it. Then I used Notepad (or Word pad; but NOT Word) to make the change directly to the php file.

    Then, after changing the Shelf Theme .php file, I added this shortcode:

    [sociable/]

    directly into the html code of the post itself -- right where I wanted the social icons to appear. Then, in the Sociable admin area, I turned off all Location placements (because it was appearing twice -- once where I told it to, and also where Sociable's Location told it to).

    I hope that's specific enough? I'm sorry the site's not live, yet; to see. Feel free to write again, if not?

    Marta Victoria

    http://www.martavictoria.com

  11. jcmoyon
    Member
    Posted 2 years ago #

    Hi Marta,

    I don't know where I went wrong first time or whether your explanation was clearer ;-) but I've got it in the end.

    Thanks a bomb ! (or words to that effect...)
    Jean-Claude

  12. jdev
    Member
    Posted 1 year ago #

    I prefer using shortcode exec php and use the php code in there. :)

  13. igorlaszlo
    Member
    Posted 1 year ago #

    Under the line add_filter( 'the_excerpt', 'auto_sociable' ); in the sociable.php file (found under wp-content/plugins/sociable/), put this line:
    add_shortcode( 'sociable', 'sociable_shortcode' );

    it works fine now with this !

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags