• Resolved tuponlol

    (@tuponlol)


    Hi all,

    I’m trying to add a FB like button to my single post PHP file, but I’m having trouble with where I want it to appear. I want it on the same line as my other two buttons (retweet, FB share), but when I insert the function call as directed, the like button appears on a new line. The code I’m using is below, with the first function for retweet, the second for FB share, and the third for FB like.

    <p><?php if (function_exists('topsy_retweet_small')) echo topsy_retweet_small(); ?><?php if(function_exists("SFBSB_direct")) {echo SFBSB_direct();}?><?php if(function_exists("wpfblike")) {echo wpfblike();} ?></p>

    You can see what the end result is here: https://www.blueseatblogs.com/2010/10/17/new-lines-at-practice/

    How do I get the FB Like button on that first line with the other two buttons?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter tuponlol

    (@tuponlol)

    I had an issue similar to this a few months ago, and I added this line to my stylesheet .topsy_widget_shortcode {float:left; margin-right:10px;}

    I tried using variations of that for the like/share buttons, but it hasn’t worked.

    Joe

    (@shopping-guide)

    The Facebook ‘like’ button is being added via an iFrame so floating it will not help. You will need to use a table to get them all to show on the same row..

    <table>
    <tr>
    <td>
    <!-- Retweet Button Code -->
    </td>
    <td>
    <!-- Facebook Share Button Code -->
    </td>
    <td>
    <!-- Facebook Like Button Code -->
    </td>
    </tr>
    </table>

    Each instance of <!– Retweet Button Code –> needs to be replaced with the actual code for including the Twitter and Facebook buttons.

    Joe

    Joe

    (@shopping-guide)

    Here try this, just copy and paste over the existing code you included in the original post:

    <table id="socialshare" style="width:100%;">
    <tr>
    <td align="left">
    <!-- Retweet Button Code -->
    <?php if (function_exists('topsy_retweet_small')) echo topsy_retweet_small(); ?>
    <!-- Retweet Button Code [END]-->
    </td>
    <td align="center">
    <!-- Facebook Share Button Code -->
    <?php if(function_exists("SFBSB_direct")) {echo SFBSB_direct();}?>
    <!-- Facebook Share Button Code [END]-->
    </td>
    <td align="right">
    <!-- Facebook Like Button Code -->
    <?php if(function_exists("wpfblike")) {echo wpfblike();} ?>
    <!-- Facebook Like Button Code [END]-->
    </td>
    </tr>
    </table>

    You can further style the layout and positioning by editing the css for the #socialshare table in your css stylesheets.

    Joe

    Thread Starter tuponlol

    (@tuponlol)

    That worked! Thanks Joe!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Buttons on same line in single post’ is closed to new replies.