Insert custom post type shortcode into header

Support MB Custom Post Type Insert custom post type shortcode into header

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #38922
    eduardorandom@yahoo.com[email protected]
    Participant

    Hi,
    I been trying to insert header a shortcode from metabox for language specifics into the header.
    Aka something like this
    <link rel="alternate" href="website.com/en/item" hreflang="en" />
    <link rel="alternate" href="website.com/es/item" hreflang="es" />

    Been trying to use this in header:
    <?php
    echo do_shortcode('[mb_frontend_form id='url' post_fields='title,content']');
    ?>

    No luck, it gives me this error
    Uncaught Error: syntax error, unexpected 'url' (T_STRING), expecting ')'

    Not sure if MB views can help?

    #38937
    PeterPeter
    Moderator

    Hello there,

    There is an error when using the single quote in your code, it should be

    echo do_shortcode('[mb_frontend_form id="url" post_fields="title,content"]');
    
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.