Digital experiences for all disciplines
New Landing › How can we help? › Atelier › 3 questions › Reply To: 3 questions
June 22, 2015 at 8:48 am
#186823
Hey,
1) Rui has made a handy code snippet that you can use in your child theme. Ref: http://www.swiftideas.com/forums/topic/question-regarding-social-sharing-in-posts/#post-181942
It’s only those 3 by default but you can add more modifying the social function.
Add this to the functions.php of your child theme and add your social links below the existing ones.
/* SOCIAL SHARE SHORTCODE
================================================= */
if ( !function_exists( 'sf_social_share' ) ) {
function sf_social_share( $atts = null ) {
extract( shortcode_atts( array(
"center" => '',
), $atts ) );
if ( sf_current_theme() == "atelier" ) {
global $post;
$image = wp_get_attachment_url( get_post_thumbnail_id() );
$page_permalink = urlencode(get_the_permalink());
$page_title = get_the_title();
$page_thumb_id = get_post_thumbnail_id();
$page_thumb_url = wp_get_attachment_url( $page_thumb_id );
$share_output = "";
if ( $center == "yes" ) {
$share_output .= '
<div class="sf-share-counts center-share-counts">';
} else {
$share_output .= '
<div class="sf-share-counts">';
$share_output .= '
<h3 class="share-text">'.__("Share", 'swift-framework-plugin').'</h3>
';
$share_output .= '<a class="sf-share-link sf-share-fb" href="https://www.facebook.com/sharer/sharer.php?u='.$page_permalink.'&height=640&width=660&resizable=0&toolbar=0&menubar=0&status=0&location=0&scrollbars=0"><i class="fa-facebook"></i><span class="count">0</span></a>';
$share_output .= '<a class="sf-share-link sf-share-twit" href="http://twitter.com/share?text='.$page_title.'&url='.$page_permalink.'&height=640&width=660&resizable=0&toolbar=0&menubar=0&status=0&location=0&scrollbars=0"><i class="fa-twitter"></i><span class="count">0</span></a>';
$share_output .= '<a class="sf-share-link sf-share-pin" href="http://pinterest.com/pin/create/button/?url='.$page_permalink.'&media='.$page_thumb_url.'&description='.$page_title.'&height=640&width=660&resizable=0&toolbar=0&menubar=0&status=0&location=0&scrollbars=0"><i class="fa-pinterest"></i><span class="count">0</span></a>';
$share_output .= '
</div>
';
}
return $share_output;
} else {
global $post;
$image = wp_get_attachment_url( get_post_thumbnail_id() );
if ( $center == "yes" ) {
$share_output = '
<div class="article-share share-center" data-buttontext="' . __( " data-image="' . $image . '"></div>
';
} else {
$share_output = '
<div class="article-share" data-buttontext="' . __( " data-image="' . $image . '"></div>
';
}
return $share_output;
}
}
add_shortcode( 'sf_social_share', 'sf_social_share' );
}
2) Could I take a look at your WP setup? Please post us a login credential.
Thanks,
David.