Creating own shortcode to get_template_part ? (3 posts)

  1. johnfotios
    Posted 2 years ago #

    I want to define my own shortcode in Functions .php, and I want it to get a .php file from the theme.

    I've created a map.php, and want the shortcode [map] to pull it in where ever. It doesn't have to have a button on TinyMCE or anything. Just to work when I type it in.

    I've found a plugin which lets you create your own shortcodes and use them to return text, but I doubt it'll let me use php. Although I might just need to return html actually.

    I'll have a think x)

  2. s_ha_dum
    Posted 2 years ago #

    Did you have a question?

  3. Marty Spellerberg
    Posted 2 years ago #

    Hi John,

    I've created a plugin for that.


    You'll be able to call your part using the syntax [template part="map"]

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.