• I’m using the Custom Field Template plugin to pull in several images to my post. Within the post the image thumbnail and caption display just fine. I’m also trying to dynamically pull the images in the sidebar, but when I use the code below to call the image, the HTML Code is displaying in the caption box. This is what I see in the sidebar:

    [caption id="attachment_146" align="alignleft" width="150" caption="
    Text displayed in the Caption
    "]THE IMAGE DISPLAYS HERE[/caption]

    Here’s the actual code that calls the image:

    <div id="secondary" class="widget-area" role="complementary">
    	<div id="attachment" class="wp-caption alignleft" style="width: 140px">
    	<?php
    		global $wp_query;
    		$postid = $wp_query->post->ID;
    		echo get_post_meta($postid, 'Image_1', true);
    		wp_reset_query();
    	?>
    	</div>
    
    </div>

    What I would like to do is use the image and caption but get rid of the HTML code that displays, OR use just the image itself without the caption or the thumbnail box.

    I’ve tried to use the information in the following posts but have not been successful (they don’t allow me to set the width at 140px):
    Link 1
    Link 2

    I’m very new to WordPress and trying to learn a lot of this as I go. Thanks in advance for your help.

  • The topic ‘[Plugin: Custom Field Template] Caption in Sidebar shows HTML Code’ is closed to new replies.