• I am trying to make a page template for easy implementation of iframes
    using a custom field from the page. the custom field is called framesrc, and contains the destination URI for the iframe. My code is messy, so I can’t get it to work. Can somebody help?

    <?php
    /*
    Template Name: framepage
    */
    ?>
    <?php get_header(); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <?php the_content(); ?>
    <iframe src="<?php get_post_meta(the_post, framesrc, true); ?>" class="framepost">
    </iframe>
    
    <?php endwhile; endif; ?>
    
    <?php get_footer(); ?>

The topic ‘iframe page template’ is closed to new replies.