Home / Forums / DynamiX Support / Show excerpt/content on search results page

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts

  • Ronnie Pisani
    Participant
    Hello,

    Is it possible to show more then the page/post title on the search results page?  I would like to get the except or content of the page listed as well.

    Any advice or direction would be greatly appreciated.

    Thanks,

    Ronnie

    Andy
    Andy
    Keymaster

    Hi,

    Replace the entire contents of DynamiX/search.php with the following:


    <?php get_header();

    /******************************************************************/

    /* Page Variables */

    /******************************************************************/

    $DYN_layout=get_option("arhlayout");

    if(get_option("arhexcerpt")) {

    $DYN_arhexcerpt = get_option("arhexcerpt"); // Excerpt Value

    } else {

    $DYN_arhexcerpt = "55";

    }

    /******************************************************************/

    /* Page Variables *END* */

    /******************************************************************/


    ?>



    <?php if($DYN_hidecontent!="yes") { ?>


    <?php if($DYN_layout!="layout_four" && $DYN_layout!="layout_five") {


    get_sidebar();


    } ?>


    <div class="mid-wrap <?php


    if($DYN_layout=="layout_one") { ?> left out-full <?php }


    elseif($DYN_layout=="layout_two") { ?> right out-threequarter <?php }


    elseif($DYN_layout=="layout_three") { ?> right out-half <?php }


    elseif($DYN_layout=="layout_four") { ?> left out-threequarter <?php }


    elseif($DYN_layout=="layout_five") { ?> left out-half <?php }


    elseif($DYN_layout=="layout_six") { ?> left out-half <?php }


    else { ?> left out-threequarter <?php }


    ?>">


    <div id="content">

    <?php if ( have_posts() ) : ?>



    <h2 class="pagetitle"><?php _e('Search Results For: ', 'DynamiX' ); ?> <?php /* Search Count */ $allsearch = &new WP_Query("s=$s&showposts=-1"); $key = wp_specialchars($s, 1); $count = $allsearch->post_count; echo '<span class="search-terms"> "'. $key .'</span>" ( '. $count . ' '. __('articles found','DynamiX'). ' )'; wp_reset_query(); ?></h2>


    <?php while (have_posts()) : the_post(); ?>



    <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php $title = get_the_title(); $keys= explode(" ",$s); $title = preg_replace('/('.implode('|', $keys) .')/iu', '<strong class="search-excerpt"></strong>', $title); ?><?php echo $title; ?></a></h3>


    <?php if ( empty($post->post_excerpt) ) {

    the_excerpt_reloaded($DYN_arhexcerpt, '<a><br /><p>', 'content', false);

    } else {

    the_excerpt();

    }?>



    <?php endwhile; ?>

    <?php else : ?>


    <h2><?php _e('No posts found. Try a different search? ', 'DynamiX' ); ?></h2>


    <?php endif; ?>

    </div><!-- /content -->

    <div class="clear"></div>

    <?php include(CWZ_FILES .'/inc/wp-pagenavi.php');


    if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>

    </div><!-- /mid-wrap -->


    <?php get_sidebar(); ?>


    <?php } // Hide Content *END* ?>


    <?php get_footer(); ?>
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.