WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. egilarntzen
    Member
    Posted 9 months 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.

Reply

You must log in to post.

About this Topic