Link to home
Start Free TrialLog in
Avatar of Andy6350
Andy6350

asked on

Word Press separating is_archive and is_search within loop.php

Can anyone help me with modifying the loop.php file in the twentyten theme for wordpress.

I would like to display search results totally different to my archive results.

can anyone advise what part of code am i changing? i take it its within the loop.php where it says

<?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; ?>

Avatar of gwkg
gwkg
Flag of United States of America image

You say you want to display archive and search differently, but your code is saying to only display the excerpts for archives and search.

Even the comment says // Display excerpts for archives and search

Everything that isn't an archive or search shows the_content
Avatar of Andy6350
Andy6350

ASKER

Thank you for responding

I changed the above code to the code attached so that i could display my posts results different to my search results.

 the following link shows what my posts display like

http://www.bluebean.org.uk/current/category/176000-250000/

the link below shows the issues i have with the search, not all the content seems to appear in the content div, only the first post.

http://www.bluebean.org.uk/current/?x=52&y=16&s=house


If this is not clear then let me know

Many Thanks,
loop.php
ASKER CERTIFIED SOLUTION
Avatar of gwkg
gwkg
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial