Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sticky Sharebar with static links
<?php
if ( ! function_exists( 'ah_sticky_sharebar' ) ) :
/**
* Statische Share-Buttons für die einzelnen Artikel - Facebook, Twitter, Google + und Xing.
*
* @uses Hook "evolution_after_thumbnail()"
*/
function ah_sticky_sharebar() {
global $post;
?>
<div class="icon-bar">
<a class="facebook" title="Bei Facebook empfehlen" href="https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;t=<?php echo rawurlencode(strip_tags(get_the_title())) ?>" target="blank" rel="nofollow"><i class="icon-facebook" aria-hidden="true"></i></a>
<a class="twitter" title="Bei Twitter empfehlen" href="https://twitter.com/intent/tweet?source=webclient&amp;text=<?php echo rawurlencode(strip_tags(get_the_title())) ?> <?php echo urlencode(get_permalink($post->ID)); ?>" target="blank" rel="nofollow"><i class="icon-twitter" aria-hidden="true"></i></a>
<a class="googleplus" title="Bei Google+ empfehlen" href="https://plusone.google.com/_/+1/confirm?hl=de&amp;url=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;title=<?php echo rawurlencode(strip_tags(get_the_title())) ?>" target="blank" rel="nofollow"><i class="icon-google-plus" aria-hidden="true"></i></a>
<a class="xing" href="http://www.xing.com/app/user?op=share;url=<?php echo urlencode(get_permalink($post->ID)); ?>;title=<?php echo rawurlencode(get_the_title()); ?>;provider=<?php echo rawurlencode(get_bloginfo('name')); ?>" target="blank" title="Bei XING empfehlen"><i class="icon-xing" aria-hidden="true"></i></a>
</div>
<?php }
endif;
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.