WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Searchresults do not display date of every post

[Resolved] Searchresults do not display date of every post

  • Jack

    @moxie

    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

Viewing 2 replies - 1 through 2 (of 2 total)
  • esmi

    @esmi

    Forum Moderator

    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>

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Searchresults do not display date of every post’ is closed to new replies.