Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter jclements@fishbowl.com

    (@jclementsfishbowlcom)

    I figured it out (that’s what happens when you post after investigating something for 6 hours — you figure it out yourself).

    My clue was Mike’s helpful post at http://www.relevanssi.com/knowledge-base/query_posts/, directing me to look at my theme’s search.php file.

    My problem was different from the post, though: my theme assumed I’d be using WordPress’s search, which indexes only posts, not pages. So the theme only showed results for posts and portfolio posts. I added this to get mine working (and since I want to direct people to pages before posts, I put it higher up in the document):

    <h2>Pages</h2>
    <dl>
    <?php
    // return only our post items
    $i = 0;
    while( have_posts() ) : the_post();
    if( $post->post_type == ‘page’ ) {
    $i++;
    printf(‘<dt>%2$s</dt><dd>%3$s</dd>’, get_permalink(), get_the_title(), get_the_excerpt());
    }
    endwhile;
    if( $i == 0 ) { printf(‘<p>%s</p>’, __(‘None’, ‘pixellin’)); }
    ?>
    </dl>

Viewing 1 replies (of 1 total)