Shortcode / plugin with custom (flexible) output

The first problem you didn’t even mention is: you are putting shortcodes into a theme. Shortcodes are pure plugin territory, because they are changing post content and must survive a theme switch. Once you fixed that and moved the shortcodes to a plugin named inferno_shortcodes, the rest is easy: In your plugin ask for theme … Read more

do_shortcode within a shortcode

You can try this: add_shortcode( ‘content’,’content_callback’ ); function content_callback( $atts, $content = NULL ){ $atts = shortcode_atts(array( ‘pid’ => ”, ), $atts); if( ! is_int( 1 * $atts[‘pid’] ) ) return “<!– Shortcode Error: pid must be an integer –>”; if( absint( $atts[‘pid’] ) === get_the_ID() ) return “<!– Shortcode Error: pid can’t be the … Read more