You must be logged in to post Login


Lost Your Password?

Search Forums:


 






Minimum search word length is 4 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

how do I truncate the search results

UserPost

12:17 am
October 18, 2007


Dan

Guest

How do you get the search results to truncate so that only x number of lines are shown in the result for each item in the list of results?

12:18 am
October 18, 2007


Jean-Luc

Admin

posts 1125

I use the_excerpt in search.php (see WordPress – Template Tags – the_excerpt).

Jean-Luc

12:19 am
October 18, 2007


Dan

Guest

Sorry to be a bother but I’m new to WP. I am using a downloaded template and the only search.php I can find is not in that template but in the default template. Is this the one I modify, and, if so, what and where do I put the excerpt code? I’m using WP 2.3 by the way.

12:20 am
October 18, 2007


Jean-Luc

Admin

posts 1125

In the WordPress default theme, I see this in search.php :

    <h3 id="post-<?php the_ID(); ?>"> *** </h3>
    <small><?php the_time('l, F jS, Y') ?></small>

    <p class="postmetadata"> *** </p>

In the theme we use here, I have this :

    <h3 id="post-<?php the_ID(); ?>"> *** </h3>
    
    <div class="entry">
     <?php the_excerpt() ?>
    </div>
  
    <p class="postmetadata"> *** </p>

Jean-Luc

12:21 am
October 18, 2007


Dan

Guest

Thanks, that pointed me in the right direction and I was able to get it working like I desired. I really like this plugin for the way my site will be structured. Thanks again for your quick response and help.


About the InternetOfficer.com Forum

Forum Timezone: UTC 1

Most Users Ever Online: 302

Currently Online:
15 Guests

Currently Browsing this Topic:
1 Guest

Forum Stats:

Groups: 2
Forums: 9
Topics: 638
Posts: 2709

Membership:

There are 257 Members
There have been 302 Guests

There is 1 Admin
There is 1 Moderator

Top Posters:

cssfsu – 55
deepakgupta – 34
albert_newton – 30
cosminpana – 20
DTNMike – 19
ahtshun83 – 17

Recent New Members: raju, todd2taylor, sbdcunha, mansigill1987, ThomasDuh, ThomasKic

Administrators: Jean-Luc (1125 Posts)

Moderators: Jean-Luc (1125 Posts)