Hot answers tagged

1

You can use output buffering to get the template output and return it in place of the emptied shortcode content: if ($pos !== false) ob_start; get_template_part('content-gallery.php'); $contentgallery = ob_get_contents(); ob_end_clean(); return substr_replace( $content, $contentgallery, $pos, strlen($shortcode[0]) );` } EDIT It might ...



Only top voted, non community-wiki answers of a minimum length are eligible