Editing search results.
-
Hello WordPress Wizards.
I have done some googling for this and all of the results seem to be very vague ‘please do all the work for me’ posts and unsurprisingly no one has had the patients to help resolved them.
All i an looking to do is to wrap each search result in a div so that i can customise the look. This is what i have so far:
Inside the loop i have found:
<?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?> <?php the_excerpt(); ?> <?php else : ?>
So within this i have simply appended an opening and closing of a div before and after the excerpt(); like so:
?php echo '<div id="searchResult">' . the_excerpt() . '</div>' ?>
However this doesn’t behave as i would expect. When i do a search it adds both the opening and closing after the each search result. Am i editing the right section of the loop or is it just my php?
Cheers in advance.
- The topic ‘Editing search results.’ is closed to new replies.