Forums

Display Custom Fields on a list (4 posts)

  1. Alejandro Urrutia
    Member
    Posted 3 years ago #

    Hi everyone, I have in several posts a custom field (promoimage) with value: "a path to an image".
    On my blog index I want to show all my posts with that custom field as images.

    Here's the code I got:

    <div id="slider">
            <ul id="sliderContent">
    
                <li class="sliderImage">
                            <img src="<strong>??????</strong>" />
                    <span class="top"><strong>Title text 1</strong><br />Content text 1...</span>
                </li>
                 <div class="clearall sliderImage"> </div>
            </ul>
    </div>

    thanks and wait for your help.

  2. MichaelH
    Volunteer
    Posted 3 years ago #

  3. Alejandro Urrutia
    Member
    Posted 3 years ago #

    Thanks MichaelH

  4. Alejandro Urrutia
    Member
    Posted 3 years ago #

    I tried everything I can, but I cant get anything.

    I'm using some code examples in The Loop but I retrieve nothing, that's my code:

    <?php if (
    		  have_posts()
    		 	 ) : while (
    		  have_posts()
    		  	) : the_post(); ?>
    
        <?php $key_1_value = get_post_custom('promoimage', false); ?>
    				<img src="<?php echo $key_1_value; ?>" alt="" />
              		<?php endwhile; ?>
    <?php endif; ?>

    I'm not seeing any image, of course promoimage is the right key.
    Any idea?

Topic Closed

This topic has been closed to new replies.

About this Topic