• Resolved sohinc

    (@sohinc)


    hello.. i love this plugin and but i am trying to use it to display info automatically so for this i need to know how to display shortcode inside of another shortcode in php… lets say i have a shortcode that returns name of a city [city] and then i have another shortcode that would return list of coffee shops in a particular city which would need to be set up like this… [search=”coffee” location=”[city]“] … if you can please tell me on how to display that above shortcode in php where there is shortcode inside of a shortcode i would really appreciate this. I know you have to do_shortcode but its not letting me put shortcode inside of another one so any help in this regarad will be appreciated. thanks

    https://www.ads-software.com/plugins/yelp-widget-pro/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Devin Walker

    (@dlocc)

    HI there – I believe shortcodes do not automatically nest without do_shortcode as you mentioned — you have to to do something like:

    echo do_shortcode('[search ="coffee" location="'.do_shortcode('[city]')."']');

    Please note I have not tested the above but it should lead you down the right road!

    Plugin Author Devin Walker

    (@dlocc)

    Marking this as resolved due to inactivity. If you have anymore questions please post an additional topic!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how do i put shortcode inside a shortcode in php’ is closed to new replies.