WordPress.org

Ready to get started?Download WordPress

Forums

Display Image on archive or search (1 post)

  1. nencor
    Member
    Posted 1 year ago #

    i want to display every first image of post on archive, or search page. i am using twenty ten theme on my site

    i have change the following code on loop.php

    <?php if ( is_archive() || is_search() ) : // Display excerpts for archives and search. ?>
    			<div class="entry-summary">
    				<?php the_excerpt(); ?>
    			</div><!-- .entry-summary -->
    		<?php else : ?>
    			<div class="entry-content">
    				<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
    			</div><!-- .entry-content -->
    		<?php endif; ?>

    into

    <?php if ( is_archive() || is_search() ) : // Display excerpts for archives and search. ?>
    			<div class="entry-summary">
    				<?php the_content(); ?>
    			</div><!-- .entry-summary -->
    		<?php else : ?>
    			<div class="entry-content">
    				<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
    			</div><!-- .entry-content -->
    		<?php endif; ?>

    but it has no effect

    did i make any mistake ? please help

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.