Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Fat Free Social Share WordPress
<div class="dev-share-buttons">
<a class="button full facebook" href="<?php the_permalink(); ?>&t=<?php the_title(); ?>" target="_blank" rel="nofollow"> Facebook</a>
<a class="button full twitter" href="<?php the_title(); ?>&url=<?php the_permalink(); ?>&via=AbhishekCTRL" target="_blank" rel="nofollow"> Twitter</a>
<a class="button full google" href="<?php the_permalink(); ?>" onclick=",
'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" target="_blank" rel="nofollow"> Google+</a>
<a class="button full pinterest" href="<?php the_permalink(); ?>&media=<?php
$args = array(
'numberposts' => 1,
'order'=> 'DESC',
'post_mime_type' => 'image',
'post_parent' => $post->ID,
'post_type' => 'attachment'
$get_children_array = get_children($args,ARRAY_A); //returns Array ( [$image_ID]...
$rekeyed_array = array_values($get_children_array);
$child_image = $rekeyed_array[0];
$firstimage_attributes = wp_get_attachment_image_src( $child_image['ID'], full );
echo $firstimage_attributes[0];
?>&description=<?php $excerpt = strip_tags(get_the_excerpt());
echo $excerpt; ?>" target="_blank" rel="nofollow"> Pinterest</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.