Shortcode in custom written template file

Support MB Views Shortcode in custom written template file

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #30873
    PAUL TUNNICLIFFEPAUL TUNNICLIFFE
    Participant

    Is there a way to insert a shortcode into a custom written php file?
    I believed you should be able to use <?php echo do_shortcode('[restricted]'); ?>

    but because MB quotes the name [mbv name="test1"] it causes an error on the page.

    #30877
    Long NguyenLong Nguyen
    Moderator

    Hi,

    You can insert the View shortcode to the PHP code as well.

    echo do_shortcode('[mbv name="my-shortcode"]');

    Remember to select the View type: Shortcode, screenshot https://imgur.com/6LXzgym

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.