WordPress.org

Forums

Display "read more" only if no excerpt (1 post)

  1. egilarntzen
    Member
    Posted 1 year ago #

    URL: http://www.lofotenmusicfestival.no/wordpress/?page_id=55

    I have this code in my content.php:

    <?php if ( is_search() || is_home() ) : // Only display Excerpts for Search and home ?>
    		<div class="entry-summary">
    			<?php the_excerpt();
    echo "<a href='".get_permalink()."' class='read-more'>Les mer</a>"; ?>
    		</div><!-- .entry-summary -->
    		<?php else : ?>
    		<div class="entry-content">
            	<?php the_content(); ?>
            </div><!-- .entry-content -->
    		<?php endif; ?>

    But even if I don't have excerpt in two of these posts, it still displays the "read more".

    Any ideas?
    This is a child theme for twenty twelve by the way.

    Any help would be most appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic