Created
December 27, 2011 18:03
-
-
Save matthiaspabst/1524625 to your computer and use it in GitHub Desktop.
WordPress Mini-Tutorial: In Artikeln und auf Seiten zweispaltig schreiben
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>'; | |
} | |
add_shortcode("leftcolumn", "basic_leftcolumn"); | |
// Rechte Spalte | |
function basic_rightcolumn($atts, $content = null) { | |
if(!empty($content)){ | |
return do_shortcode('<div class="rightcolumn">' . $content . '</div>');} | |
return '<div class="rightcolumn">' . $content . '</div>'; | |
} | |
add_shortcode("rightcolumn", "basic_rightcolumn"); | |
// Spalte mit vollständiger Breite | |
function basic_topcolumn($atts, $content = null) { | |
if(!empty($content)){ | |
return do_shortcode('<div class="topcolumn">' . $content . '</div>');} | |
return '<div class="topcolumn">' . $content . '</div>'; | |
} | |
add_shortcode("topcolumn", "basic_topcolumn"); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Zweispaltiger Inhalt mit Shortcode */ | |
.entry-content .leftcolumn, .entry-content .rightcolumn {width: 48%; } | |
.entry-content .leftcolumn {float: left; } | |
.entry-content .rightcolumn {float: right; } | |
.entry-content .topcolumn {clear: both; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[leftcolumn]Hier steht der Text der linken Spalte.[/leftcolumn] | |
[rightcolumn]Hier steht der Text der rechten Spalte.[/rightcolumn] | |
[topcolumn]Hier steht der Text der breiten Spalte.[/topcolumn] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Artikel: http://matthiaspabst.de/wordpress-mini-tutorial-in-artikeln-und-auf-seiten-zweispaltig-schreiben/