Forums

Custom Field Template
How do i actually OUTPUT the values from this plugin?? (2 posts)

  1. zesty1
    Member
    Posted 8 months ago #

    This is F*ing driving me nuts how undocumented this is.....

    I have several standard custom fields saved (not using the plugin)... these work fine, and then I have 6 tinyMCE rich-text areas that I need to output (images and all). I'm trying to output just 1 of them and its not working (Overview)

    I have no idea how to output it in my loop-surgeon.php template however....

    <?php
    // Retrieve custom meta values from post if they're present
    $email = htmlspecialchars(get_post_meta($post->ID, "email", true));
    $phone = htmlspecialchars(get_post_meta($post->ID, "phone", true));
    $address = htmlspecialchars(get_post_meta($post->ID, "address", true));
    $website = htmlspecialchars(get_post_meta($post->ID, "website", true));
    
    //Begin Custom Fields Template variables
    $overview = htmlspecialchars(get_post_meta($post->ID, "overview", true));
    
    ?>
    
    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	<h1 class="entry-title"><?php the_title(); ?></h1>
    
    	<?php echo $email; ?>
    
    	<?php echo $overview; ?>
    
    	<div class="entry-content">
    		<br style="clear:both;" />
    		<?php the_content(); ?>
    	</div><!-- .entry-content -->
    
    </div><!-- #post-## -->
    <?php endwhile; // end of the loop. ?>

    http://wordpress.org/extend/plugins/custom-field-template/

  2. proximity2008
    Member
    Posted 8 months ago #

    What you are doing looks fine to me.

    I presume your while loop starts before your code snippet you've supplied.

    Go into the database into the post_meta table and check that the meta key exists, and it also has a value.

Reply

You must log in to post.

About this Plugin

About this Topic