Adding ShareThis button to single post *only* in Thesis


/ Published in: PHP
Save to your folder(s)

Once the automatic button placement for the ShareThis plugin has been deactivated, this function added to custom_functions.php will place the button on single posts only (not the home page).


Copy this code and paste it in your HTML
  1. // Add ShareThis to single posts only
  2. function custom_byline() {
  3. if (is_single()) {
  4. ?>
  5. <p class="custom_byline">
  6. <?php if (function_exists('sharethis_button')) { sharethis_button(); } ?>
  7. </p>
  8. <?php }
  9. }
  10. add_action('thesis_hook_after_post', 'custom_byline');

URL: http://testonly.philipbarron.net/archives/background-image/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.