Output a shortcode inside an echo for wordpress

I am trying to write a shortcode that has another shortcode nested inside of it. The [map id=”1″] shortcode is being generated from a different plugin but I want to have the map display when I execute this shortcode.

I don’t think this is the best way to go about this but I am still new to php coding.

add_shortcode( 'single-location-info', 'single_location_info_shortcode' );
    function single_location_info_shortcode(){
        return '<div class="single-location-info">
                    <div class="one-half first">
                    <div class="one-half">
                        <h3>Header 2</h3>
                        <p>Copy 2............</p>
                        <?php do_shortcode( '[map id="1"]' ); ?>

I dont think I should be trying to call php from within a return…. I though I read somewhere that I should use a “heredoc” but I have been unable to get it to work correctly.

Any thoughs?


Source: shortcode

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.