Support » Themes and Templates » Using images in custom fields

  • I am attempting to change the theme to call these sidebar images from a custom field titled “sidebar” instead of from the featured image of each post. I am new at this and any help would be greatly appreciated.

    <div id="inner_sidebar">
    					$mypages = get_pages( array( 'child_of' => 9, 'sort_column' => 'post_title', 'sort_order' => 'asc' ) );
    					foreach( $mypages as $page ) {
    						$content = $page->post_content;
    						if ( ! $content ) // Check for empty page
    						$content = apply_filters( 'the_content', $content );
    					<div class="item city">
    						<?php echo get_the_post_thumbnail($page->ID, 'thumbnail'); ?>
    						<a href="<?php echo get_page_link( $page->ID ); ?>"><img class="frame" src="<?php bloginfo('url'); ?>/images/city_image_frame_thumb.png" alt="" /></a>
    						<a class="title" href="<?php echo get_page_link( $page->ID ); ?>"><?php echo $page->post_title; ?></a>					</div>
  • The topic ‘Using images in custom fields’ is closed to new replies.