This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Iframe on certain pages indtead of Metaslider

Resolved 4 replies premiumthemetheme-vantage
11 years ago · Last reply by Andrew Misplon 11 years ago

Im trying to replace the Metaslider with an iframe. I have succeeded in doing this with the code below (from header.php).
The thing is… I only want my iframe to show up on certain pages, but for some reason the code below shows my iframe on all pages. Has this something to do with other theme settings?
(I disable the metaslider from the themesettings)
————————————————————————

if(is_page(‘About’)) {
echo ‘
frameborder=”0″>

‘;
}

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Replies

4
  1. wizlore 11 years, 5 months ago
    <?php vantage_render_slider() ?>
    if(is_page('About')){
    echo '<div class="canvasWrapper">
    <iframe width="1366" height="400" src="http://www.catcheye.dk/test/index.html"> frameborder="0"></iframe>
    </div>';
    }
    <?php do_action( 'vantage_before_main_container' ); ?>
  2. Andrew Misplon Staff 11 years, 5 months ago

    Hi wizlore

    Just at a glance it looks like your statement needs to be wrapped in PHP tags and you might be closing your iFrame too early. So this is how it might look instead:

    <?php vantage_render_slider() ?>
    <?php
    if(is_page('About')){
    echo '<div class="canvasWrapper">
    <iframe width="1366" height="400" frameborder="0" src="http://www.catcheye.dk/test/index.html"></iframe>
    </div>';
    }
    ?>
    <?php do_action( 'vantage_before_main_container' ); ?>

    To confirm, this isn’t tested, but those two issues I’ve raised would stop this from working.

  3. wizlore 11 years, 5 months ago

    Works as a charm..
    Thanks

  4. Andrew Misplon Staff 11 years, 5 months ago

    Awesome, glad to hear that helped. All the best.

Replies on this thread are closed.

Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Have a different question or issue?

Start New Thread