WordPress.org

Support

Support » How-To and Troubleshooting » .entry custom background image using custom fields

.entry custom background image using custom fields

  • Hi folks. Looking for a way to apace a path to an image in a Custom Field that will become the background image to the div class .entry.

    my PHP is extremely limited so any help appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)
  • I was trying something like this in the loop:

    <div id="content" class="narrowcolumn">
    <?php query_posts('category_name=testimonial&showposts=100'); ?>
    
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    
            <div class="lead-image-wrapper">
    		<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    
            <?php $image = get_post_meta($post->ID, 'lead_image', true); ?>
    <img src='<?php echo $image; ?>' />
    
    			<div class="entry">
    				<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
    
    				<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    
    	<small id="comments"><?php comments_number('No Comments yet', 'One Comment', '% Comments' );?> to “<?php the_title(); ?>” <br /><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">View Event / Comment on Event</a></small>
    
    			</div>
    		</div>
            </div class="lead-image-wrapper">

    where I would specify a custom field “lead-image”

    OK, stupid me……
    I just say the problem:

    template looks for lead_image

    custom field specified lead-image

    🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘.entry custom background image using custom fields’ is closed to new replies.