added a ton of goodies - this is initial release 1.0.0

This commit is contained in:
Mickey Kay
2014-01-16 13:40:07 -08:00
parent 5fe327f54c
commit bbc4641551
26 changed files with 7516 additions and 2138 deletions
+43
View File
@@ -0,0 +1,43 @@
<?php
/**
* Trestle shortcodes
*
* @since 1.0.0
*
* @package Trestle
*/
/*===========================================
* Shortcodes
===========================================*/
// Fix for empty <p> tags around shortcodes
function shortcode_empty_paragraph_fix($content)
{
$array = array (
'<p>[' => '[',
']</p>' => ']',
']<br />' => ']'
);
$content = strtr($content, $array);
return $content;
}
add_filter('the_content', 'shortcode_empty_paragraph_fix');
/**
* Columns - [col class="one-half first no-list-margin"]
*
* Classes:
* - width (one-half, one-third, etc - uses native Genesis column classes in style.css)
* - first (used to specify the first column in a row)
* - no-list-margin (will cause contained list elements to collapse as one on mobile sizes)
*/
function column( $atts, $content = null ) {
extract( shortcode_atts( array(
'class' => 'one-half',
), $atts ) );
return '<div class="col ' . $class . '">' . do_shortcode( $content ) . '</div>';
}
add_shortcode( 'col', 'column' );