- This topic has 2 replies, 2 voices, and was last updated 7 years, 4 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › Post dates not displaying in results
Tagged: Post dates not displaying
Hi, I am using the Search & Filter Pro ajax functionality to return results to my page however I am seeing that some posts do not have the published date displayed inline next to the title and category(s). Then on the other hand, some posts do display the published date. Is there a setting or something I am missing?
There are two ways to show dates on posts. The most commonly used shows ONLY the date on the first post of that date, then doesn’t show it on the others of that date. The other method shows it on all posts.
Method #1 uses the function:
<?php the_date();?>
Method #2 uses the function:
<?php echo get_the_date();?>
Notice how method #2 also uses echo?
Many functions in WordPress have differences in output, for example, the_excerpt() and get_the_excerpt().
Thanks Trevor! I really appreciate your help here.
It looks like the original code in the results.php, “<?php the_date();?>”, was working inconsistently as it would only pull back dates for random posts. Possibly a bug with the plugin…
When I changed the code to “<?php echo get_the_date();?>”, all of the dates for published posts started displaying properly.
Cheers!
Matt