Custom shortcode with do_shortcode and substr
using php substr requires you add a start point when calling substr function http://php.net/manual/en/function.substr.php A possible fix: function my_shortcode_function() { $string = “”; $string = do_shortcode(‘[different_shortcode]’); $string = substr($string, 0, 4); return $string; } add_shortcode( ‘my_shortcode’, ‘my_shortcode_function’ );