• wspatt

    (@wspatt)


    My site is grassfedbeefrestaurants.com. I am using the Twenty Ten theme. Each post contains details on a particular restaurant. The restaurant name is linked to the restaurant’s URL. However, the link is not showing up in search results. Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • coopersita

    (@coopersita)

    You need to change the loop template (loop.php).

    Around line 132, you have this:

    <?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
    	<div class="entry-summary">
    		<?php the_excerpt(); ?>
    	</div><!-- .entry-summary -->

    You probably need to change it to:

    <?php if ( is_archive() ) : // Only display excerpts for archives and search. ?>
    	<div class="entry-summary">
    		<?php the_excerpt(); ?>
    	</div><!-- .entry-summary -->

    That way, the search results will show the_content() instead of the_excerpt(). The excerpt stips tags, and shortens the text. The content will show everything.

    Hope this helps.

    Thread Starter wspatt

    (@wspatt)

    Thanks for responding. I changed it exactly the way you said– deleting “|| is_search()”– but nothing happened. Then I read your explanation and changed “the_excerpt” to “the_content” and that worked! Thank you very much for pointing me in the right direction!

    Michael

    (@alchymyth)

    deleting “|| is_search()”– but nothing happened.

    <?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
    occurs more than once in loop.php; (line 109 and line 137)
    the occurrence nearest to the end of the file is the one for ordinary posts.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Links in posts not showing up in search results’ is closed to new replies.