WordPress.org

Support

Support » Themes and Templates » Display Image on archive or search

Display Image on archive or search

  • 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

  • The topic ‘Display Image on archive or search’ is closed to new replies.
Skip to toolbar