Skip to content

Instantly share code, notes, and snippets.

@matthiaspabst
matthiaspabst / wp-shortcode-css3-multicolumn.css
Created December 27, 2011 15:31
WordPress Shortcode mehrspaltiger Inhalt mit CSS3
.multicolumn {
-webkit-column-count: 2;
-moz-column-count: 2;
column-count: 2;
-webkit-column-gap: 2em;
-moz-column-gap: 2em;
column-gap: 2em;
}
<script type="text/javascript" src="http://apis.google.com/js/plusone.js">
{lang: 'de'}
</script>
@matthiaspabst
matthiaspabst / wp-shortcode-box-1.php
Created December 27, 2011 17:20
WordPress Shortcode für Box
<?php
// Shortcode für Boxen
function content_box1($atts, $content = null) {
if(!empty($content)){
return do_shortcode('<div class="box1">' . $content . '</div>');}
return '<div class="box1">' . $content . '</div>';
}
add_shortcode("box1", "content_box1");
@matthiaspabst
matthiaspabst / teilen-buttons-jquery-1.html
Created December 27, 2011 17:37
Teilen-Buttons für Twitter und Facebook per jQuery erst nach dem Inhalt laden
<!-- Sharebuttons erst nach Content laden -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
var facebook_links = new Array();
var twitter_links = new Array();
</script>
<script type="text/javascript">
$(function(){
$(window).bind("load", function(){
@matthiaspabst
matthiaspabst / touch-icons-1.html
Created December 27, 2011 17:47
Touch Icons für iOS und Android erstellen und einbinden
<link rel="apple-touch-icon-precomposed" href="http://domain.de/apple-touch-icon.png" />
@matthiaspabst
matthiaspabst / teilen-buttons-wordpress-1.html
Last active February 28, 2017 11:09
Teilen-Buttons für Facebook und Twitter ohne Plugin in WordPress integrieren
<div class="sharebuttons">
<div class="twitter">
<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="dein-twitter-name" data-url="<?php echo urlencode(get_permalink($post->ID)); ?>" data-text="<?php echo rawurlencode(get_the_title()); ?>">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
</div><!-- .twitter -->
<div class="facebook">
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;layout=button_count&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe>
</div><!-- .facebook -->
@matthiaspabst
matthiaspabst / wordpress-shortcode-zweispaltig-1.php
Created December 27, 2011 18:03
WordPress Mini-Tutorial: In Artikeln und auf Seiten zweispaltig schreiben
<?php
// Shortcodes für 2 Spalten
// Linke Spalte
function basic_leftcolumn($atts, $content = null) {
if(!empty($content)){
return do_shortcode('<div class="leftcolumn">' . $content . '</div>');}
return '<div class="leftcolumn">' . $content . '</div>';
}
@matthiaspabst
matthiaspabst / teilen-links-wordpress-1.html
Created December 27, 2011 18:12
Teilen-Links für Facebook, Twitter und E-Mail ohne Plugin in WordPress integrieren
@matthiaspabst
matthiaspabst / facebook-like-button-1.html
Created December 27, 2011 20:03
Facebook “Gefällt mir”-Button in WordPress-Theme integrieren
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink()); ?>" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px;" allowTransparency="true"></iframe>
@matthiaspabst
matthiaspabst / wordpress-404-image.php
Created February 14, 2012 17:08
404-Bild in WordPress anzeigen
<?php
if ( preg_match( '~\.(jpe?g|png|gif|svg|bmp)(\?.*)?$~i', $_SERVER['REQUEST_URI'] ) )
{
header( 'Content-Type: image/png' );
locate_template( 'images/404.png', TRUE, TRUE );
exit;
}
?>