WordPress.org

Forums

[resolved] Searchresults do not display date of every post (3 posts)

  1. Jack
    Member
    Posted 5 years ago #

    I'm using search.php to show the results of a search, but one two posts are from the same date, the date in front of the post title is not shown. How can I get it there anyway?

    This is my code for search.php:

    <div class="queryresult"><span class="searchdate"><?php the_date('d-m-Y'); ?></span><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>
    <p><?php the_excerpt(); ?></p></div>

    Link to a searchpage: http://www.spoenk.nl/?s=huis

  2. esmi
    Forum Moderator
    Posted 5 years ago #

    Try using:

    <div class="queryresult"><span class="searchdate"><?php the_time('d-m-Y'); ?></span><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>
    <p><?php the_excerpt(); ?></p></div>
  3. Jack
    Member
    Posted 5 years ago #

    I'm sorry for this late reply, but thank you! Your suggestion works and all dates are shown :)

Topic Closed

This topic has been closed to new replies.

About this Topic