Skip to content

Instantly share code, notes, and snippets.

@Perun
Last active December 18, 2015 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Perun/5802185 to your computer and use it in GitHub Desktop.
Save Perun/5802185 to your computer and use it in GitHub Desktop.
Meine Lösung um die Social-Buttons einzufügen: FB, G+, Twitter, t3n und auf Kindle lesen. 1. Zuerst kommt der Einbau in der single.php, der Einzelansicht des Artikels 2. Dann der Einbau von Javascript im Footer, mit der Abfrage ob man sich auf single.php befindet um unnötige HTTP-Anfragen zu verhindern 3. Und zu Letzt die Angaben in der CSS-Date…
<div class="weiterempfehlen">
<p>Diesen Artikel weiterempfehlen oder später lesen:</p>
<div class="twitter"><iframe src="http://platform.twitter.com/widgets/tweet_button.html?url=<?php echo rawurlencode(get_permalink()) ?>&amp;text=<?php echo rawurlencode(strip_tags(get_the_title())) ?>" style="width:105px; height:20px;" allowtransparency="true" frameborder="0" scrolling="no"></iframe></div>
<div class="fb-likeit" title="Auf Facebook empfehlen"><iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo rawurlencode(get_permalink()); ?>&amp;layout=button_count&amp;show_faces=false&amp;width=122&amp;action=recommend&amp;font=verdana&amp;colorscheme=light&amp;height=20" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:122px; height:20px;"></iframe></div>
<div class="g-plusone" data-size="medium"></div>
<div class="t3nAggregator"></div>
<div class="clearer"></div>
<div class="kindleWidget"><img style="vertical-align:middle;" src="https://d1xnn692s7u6t6.cloudfront.net/white-15.png" /><span style="vertical-align:middle;margin-left:3px;">auf Kindle (später) lesen</span></div>
</div>
/* Dynamische Social Buttons */
.weiterempfehlen {margin-bottom: 19px;}
.weiterempfehlen p {font-weight: bold; margin-bottom: 4px !important;}
.twitter, .fb-likeit, .g-plusone, .t3nAggregator {float: left; margin-right: 20px;}
.kindleWidget {margin-top: 7px; display:inline-block; padding:3px; cursor:pointer; font-size:11px; border-radius:3px; border:#ccc thin solid; background:transparent url('https://d1xnn692s7u6t6.cloudfront.net/button-gradient.png') repeat-x; background-size:contain;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment