Im using the default search widget you get with Automattic widgets, but it only searches posts not pages.
I would use the google search plugin they offer but i can't resize it for some reason(...maybe css would work?) and it messes with my sidebar a bit.
does anyone know how to include pages in the search as this would be the ideal solution?
brilliant, now displays posts and pages. wahoo.
now...
how do i format the results to display a title and a snipet? instead of every page one after the other for ever and ever down the page,
thanks again
PS, using searcheverything one by dan cameron
Not sure about that one.
I would assume something like:
<a href="<?php the_title(); ?>"><?php the_excerpt(); ?></a>
Play around with it?
which file should i be putting that into? and do i have to define what the_excerpt and the_title are? if so where? Found this as on another post...which im assuming would work so that if it was search results it displays excerpt, and if it was normal view it would show the content, but where should that go?
<?php if ( is_search() ) {
the_excerpt();
} else {
the_content();
} ?>
look in your theme's search.php and/or sidebar.php.
randymelder
Member
Posted 2 years ago #
mahalie
Member
Posted 2 years ago #
I would not use Randy's method, as it involved modifying the core, which will stop working when you upgrade. There are plugins that will extend search to pages.