WordPress.org

Ready to get started?Download WordPress

Forums

Tweak Search Page results (2 posts)

  1. xloffers
    Member
    Posted 3 years ago #

    Hi

    I would like to tidy up how search results are displayed. Currently search results show;
    - Category
    - Title
    - Post
    - More info link (link to complete post)

    My search.php generates this using the following code

    ?php if (have_posts()) : ?>

    <h1 class="pagetitle">Search Results</h1>
    <?php while (have_posts()) : the_post(); ?>
    <div class="post" id="post-<?php the_ID(); ?>">
    <?php the_category(', ') ?> <h2 class="title">" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></h2>
    <div class="entry">
    <?php the_excerpt(); ?>
    </div>
    <div>" class="links">Get Price</div>

    </div>

    My question is how do I get search results to show other data fields. For example showing in the results when the post was modified (post_modified field) or number of comments (comment_count) field).

    Hope you can help.

    Many thanks

  2. Best to search the forums specifically for the code snips on how to add the number of comments or modified times; both can be fairly involved with php. Or search for plugins, too: http://wordpress.org/extend/plugins/

Topic Closed

This topic has been closed to new replies.

About this Topic