Is there a way I could have my search results show Pages first and posts after the pages?
My site is a business site with a blog, as opposed to the blog being primary. The static pages have all the "here's what we do" stuff and ideally they would come up first if someone was searching for various services. The blog posts are more light in tone, but they're more recent so they come up first.
The search loop is from the Kubrick theme:
<?php if (have_posts()) : ?> <div class="center"> <div class="padding-bottom"> <h1><?php _e('Our Search Results', 'kubrick'); ?></h1> </div> </div> <?php while (have_posts()) : the_post(); ?> <div <?php post_class(); ?>> <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>"><?php the_title(); ?></a></h3><?php the_excerpt(); ?> </div> <?php endwhile; ?> <?php else : ?> <h2 class="center"><?php _e('No luck. Try again?', 'kubrick'); ?></h2> <?php get_search_form(); ?> <?php endif; ?>
Could I put something in there to specify that any result from a "page" would be listed before results from a "post". Or does WP not actually distinguish between pages and posts at that level? Since the static pages are "static" I could use ID's maybe?