How to Add Pinterest ‘Pin it’ to Thesis Theme

by Elaine on June 15, 2012

Thesis Tutorials – I just added Pinterest ‘Pin it’ button to my posts and pages.  Pretty neat!  When people click on it a number will show beside it how many people have pinned it.   You can add this ‘Pin it’ Pinterest button too to your Thesis website easily and without a Plugin.  I did it in just 5 seconds! (ok sorry to sound like a commercial, but it’s true!)

This is how my Thesis site looks with the ‘Pin it’ button.

cmsmind wordpress how to add pinterest to thesis 1 How to Add Pinterest Pin it to Thesis Theme Site with Pinterest Pin it Button

Overview of how to Add the ‘Pin it’ Pinterest button to your Thesis Blog:

  • Go to your Thesis Custom File Editor
  • Edit your custom_functions.php file and add the code

Here are the steps:

1.  Go to your Thesis Custom File Editor

This does involve making changes to your custom_functions.php file.  Please make a backup of this file before making any changes as any errors will cause your site to be down.  This file is very sensitive and the code must be copied exactly.

cmsmind wordpress how to add pinterest to thesis 2 How to Add Pinterest Pin it to Thesis Theme Wordpress Thesis Custom File Editor
  • Login to your Wordpress Administrator
  • On your left navigation, click on ‘Thesis’, ‘Custom File Editor’

2.  Edit your custom_functions.php file and add the code

Please backup your custom_functions.php file before making any changes.  This is where you will add the Pinterest ‘Pin it’ code that will show up on all your Pages and Posts.

cmsmind wordpress how to add pinterest to thesis 3 How to Add Pinterest Pin it to Thesis Theme Thesis blog Pinterest Pin it Code
  • Click on the ‘custom.css’ file and select ‘custom_functions.php’
  • Click on ‘Edit selected file
  • Go to to the bottom of the text box and enter the following code:

//************* Pinterest button CODE START *************/
function pinterest_post_page_pin_horiz() {
global $post;
/* HORIZONTAL PINTEREST BUTTON WITH COUNTER */
printf( ‘<div class=”pinterest-posts”><a href=”http://pinterest.com/pin/create/button/?url=%s&media=%s” class=”pin-it-button” count-layout=”horizontal”>Pin It</a><script type=”text/javascript” src=”http://assets.pinterest.com/js/pinit.js”></script></div>’, urlencode(get_permalink()), urlencode( get_post_meta($post->ID, ‘thesis_post_image’, true) ) );
}
add_action( ‘thesis_hook_before_post_box’, ‘pinterest_post_page_pin_horiz’ );
//************* Pinterest button CODE END *************/

  • At the bottom, Click on ‘Save’

And you are done!  Refresh your WordPress website and you should see the Pinterest ‘Pin it’ button on all your posts and pages.

Thanks,

Elaine

 How to Add Pinterest Pin it to Thesis Theme

Elaine

Elaine is the founder of CmsMind, an online blog providing Joomla and WordPress tutorials. Elaine lives in Toronto and when she is not online, she is either Marathon and Triathlon training or travelling and racing somewhere in the world. Find her also at: Save Money, Premium Themes and Templates, and at Webhosting Tips.

More Posts - Website

{ 3 comments… read them below or add one }

Eddie June 17, 2012 at 11:05 am

You are a truely amazing person. You have helped in so many times through your site. I can not thank you enough. Thank you so much for all that you do in here.

Reply

Elaine June 18, 2012 at 12:48 pm

Hi Eddie,
No problem! I’m glad I’m able to help you.
Thanks so much for your visit,
elaine

Reply

Kevin July 19, 2012 at 6:59 pm

thanks for the great work. Really appreciate that. I am new to wordpress and your site is a great source.

Reply

Leave a Comment

Captcha Captcha Reload

Older Post:

Newer Post: