I am looking for away to use shortcodes in post excerpts that will be called via:
$post_object->post_excerpt;
I have the function set up to pull the excerpts but I am struggling to pull the shortcode. at the moment it just returns a string EG: "[short]foo[/short]". Does anyone know what I need to add to functions.php to allow shortcode usage in this way? WP 3.6
EDIT: Also the call to the excerpt is nested inside an already existing shortcode function, which works fine.
Edit 2:
To clarify, I am using 2 function. One to create a format for the page "box":
//create box shortcode
function box( $atts, $content = null) {
$p_id = $atts['post'];
$p = get_post($p_id);
$output = '<div class="box"><a href="'.get_permalink($p_id).'"><div class="box_inner"><h1>'.$p->post_title.'</h1><p>'.$p->post_excerpt.'</p></div></a></div>';
return $output;
}
add_shortcode("box", "box");
And one to create an icon "char" (this is the function I want to use on the excerpt in the short code above):
//big text for icons shortcode
function icon( $atts, $content = null) {
return '<p style="text-align: center; font-size: 100px;>'.$content.'</p>';
}
add_shortcode("icon", "icon");
I may be way off base here, is it even possible to use shortcodes in this fashion? and if so how do I stop the excerpt from ignoring the shortcode format?