Like fix?

resolved (9 posts) (2 voices)

  1. ichain
    Member

    Dear Support

    I used the shortcodes [fblike layout="box_count"][tweet layout="vertical"][googleplusone size="tall"] for the fb like, twitter and google plus.

    Is there a way, that I can put a code into the single.php so I do not need to enter these like buttons each time I make a post?

    Thanks,

    Posted 9 months ago #
  2. ichain
    Member

    Here is a picture of the social buttons.

    Attachments

    1. Skærmbillede-2011-08-09-kl.-21.07.jpg (149.9 KB, 0 downloads) 9 months old
    Posted 9 months ago #
  3. Elliott
    Support

    Hello ichain,

    Open up /wp-content/themes/dejavu/framework.php and around line 159 you should see this,

    add_action( 'mysite_singular-post_before_entry', 'mysite_post_meta' );

    On the next line add this,

    add_action( 'mysite_singular-post_before_entry', 'msmw_display_social_buttons' , 100);

    And then at the very end of the file you should see this,

    ?>

    Before that add this,

    function msmw_display_social_buttons()
    {
         return do_shortcode('[fblike layout="box_count"][tweet layout="vertical"][googleplusone size="tall"]');
    }
    Posted 9 months ago #
  4. ichain
    Member

    Hi Elliott

    I tried to do exactly what you wrote and it didn't seem to work out?

    Any idea?

    Posted 9 months ago #
  5. Elliott
    Support

    Sorry, try this at the bottom of the file,

    function msmw_display_social_buttons()
    {
         echo '<div>'. do_shortcode('[fblike layout="box_count"][tweet layout="vertical"][googleplusone size="tall"]') . '</div>';
    }
    Posted 9 months ago #
  6. ichain
    Member

    Thank you very much. It solved the problem.

    Thank you for the good support.

    Posted 9 months ago #
  7. ichain
    Member

    OBS: as I refreshed a second time it only showed FB Like and Google Plus and then the text [tweet layout="vertical"] ?

    Posted 9 months ago #
  8. Elliott
    Support

    Try this,

    function msmw_display_social_buttons()
    {
         echo do_shortcode('[fblike layout="box_count"]');
         echo do_shortcode('[tweet layout="vertical"]');
         echo do_shortcode('[googleplusone size="tall"]');
    }

    And if possible send us a link to your site.

    Posted 9 months ago #
  9. ichain
    Member

    Perfect! That fixed it..

    Link to the site: http://ichain.dk/iChaindejavu/apple/apple-saelger-over-1-million-kopier-af-os-x-lion-pa-en-dag/

    Thanks Elliott!

    Posted 9 months ago #

Reply

You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme