Custom Fields
Re-Envisioned
Support MB Views Shortcode in custom written template file

  • Creator
    Topic
  • #30873
    PAUL 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.

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #30877
    Long 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 1 replies (of 1 total)
  • You must be logged in to reply to this topic.