Skip to content

Instantly share code, notes, and snippets.

@matthiaspabst
Created December 27, 2011 17:20
Show Gist options
  • Save matthiaspabst/1524436 to your computer and use it in GitHub Desktop.
Save matthiaspabst/1524436 to your computer and use it in GitHub Desktop.
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");
?>
/* Grüne Box */
.box1 {
float: left;
padding: 1.0em;
margin: 0 0 1.5em 0;
background-color: #cbf2cd;
border-width: 1px;
border-color: #999999;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
box-shadow: 0px 0px 5px #000000;
-moz-box-shadow: 0px 0px 5px #000000;
-webkit-box-shadow: 0px 0px 5px #000000;
}
[box1]Dieser Text steht in meiner Box. Lorem ipsum ...[/box1]
@matthiaspabst
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment