• Hi there,

    At my homepage https://businessblogschool.nl I have a video in the header. It’s an iframe embed. I replaced all my iframe video-embeds recently with [embed]. But in my page_home.php I didn’t succeed.

    This is the code now:

    <div class=”embed-container”><iframe src=”<?php the_field(‘video’); ?>” width=”300″ height=”150″ frameborder=”0″ allowfullscreen=”allowfullscreen”></iframe></div>

    The embed-container itself is responsive, so I hoped to be able to use here [embed][/embed]. Does anybody know whether this is possible?

    Thanks in advance!
    Jessie

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hi Jessie,
    Shortcodes are made to use in post/page editors. use do_shortcode() function to display shortcodes in a php file.
    Try this code in your php file:
    <?php echo do_shortcode( '[embed]'.get_field('video').'[/embed]' ); ?>
    You can find complete documentation of do_shortcode function HERE

Viewing 1 replies (of 1 total)

The topic ‘can I replace my in php-file with [embed]?’ is closed to new replies.