zourbuth

zourbuth supports this item

Supported

Popular questions for this item

How to add the Facebook Like button after the post date?

This question was asked here.

First, include the JavaScript SDK on your page once, ideally right after the opening body tag:

<div id="fb-root" />
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

Second, place the code wherever you want the button to appear on your page. In this case, open “super-post.php” around code line 150-165 add after this code:

if ( $show_date ) {
    $date_class = $date_icon ? 'sp-date' : 'sp-date sp-noicon';
    if( $show_date_link )
        $html .= "<a class="$date_class" href="$permalink">$postdate</a>";                    
    else
        $html .= "<span class="$date_class">$postdate</span>";
}

with this:
$html .=  '<div class="fb-like" data-href="' . get_permalink() . '" data-send="true" data-width="450" data-show-faces="true" />';

Third, refresh your page and you will see the button added right after the post date.

Contact the author

This author provides limited support for this item through this item's comments.

Item support includes:

  • Availability of the author to answer questions
  • Answering technical questions about item’s features
  • Assistance with reported bugs and issues
  • Help with included 3rd party assets

However, item support does not include:

  • Customization services
  • Installation services

View the item support policy

by
by
by
by
by
by