mattlawck of StudioPress
8/3/2018 - 4:03 PM

Pinterest "Pin It" Button.

Pinterest "Pin It" Button.

/* Pinterest Button
--------------------------------------------- */
 
.pinterest-button iframe {
	    margin: 10px 0;
}
<?php
 
//* Add Vertical Pinterest button
add_action( 'genesis_entry_content', 'sp_custom_pinterest_button', 5 );
function sp_custom_pinterest_button() {
     
	    printf( '<div class="pinterest-button"><a href="http://pinterest.com/pin/create/button/?url=%s&media=%s" class="pin-it-button" count-layout="vertical">Pin It</a><script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script></div>', urlencode( get_permalink() ), urlencode( genesis_get_image( array( 'format' => 'url' ) ) ) );
 
}
 
genesis();
<?php
 
//* Add No-count Pinterest button
add_action( 'genesis_entry_content', 'sp_custom_pinterest_button', 5 );
function sp_custom_pinterest_button() {
     
	    printf( '<div class="pinterest-button"><a href="http://pinterest.com/pin/create/button/?url=%s&media=%s" class="pin-it-button" count-layout="none">Pin It</a><script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script></div>', urlencode( get_permalink() ), urlencode( genesis_get_image( array( 'format' => 'url' ) ) ) );
 
}
 
genesis();
<?php

//* Add Horizontal Pinterest button
add_action( 'genesis_entry_content', 'sp_custom_pinterest_button', 5 );
function sp_custom_pinterest_button() {
     
	    printf( '<div class="pinterest-button"><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( genesis_get_image( array( 'format' => 'url' ) ) ) );
 
}
 
genesis();
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.

add_action( 'genesis_entry_content', 'sp_custom_pinterest_button', 5 );
<?php

add_action( 'genesis_entry_content', 'sp_custom_pinterest_button', 5 );
function sp_custom_pinterest_button() {
	
	/** Horizontal */
	printf( '<div class="pinterest-button"><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( genesis_get_image( array( 'format' => 'url' ) ) ) );

}

add_action( 'genesis_post_content', 'sp_custom_pinterest_button_after' );
function sp_custom_pinterest_button_after() {
	
	/** Horizontal */
	printf( '<div class="pinterest-button"><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( genesis_get_image( array( 'format' => 'url' ) ) ) );

}

genesis();
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.

add_action( 'genesis_entry_content', 'sp_custom_pinterest_button' );