I have a loop that shows the latest posts. I want to change the part that says: . get_comments_number($question->ID) . and instead of that get the date. (<?php the_time('F j, Y') ?>)
This is the loop:
$loophtml = $loophtml . "<span class='list-number-answers'>" . get_comments_number($question->ID) . " comentarios</span> · <a href='" . get_permalink($question->ID) ."'>Comentar</a>";
I’m not sure how to add ($question->ID) to the_time. Could anyone give me a hand? Thanks
I think you are looking for
get_the_time, it returns the time for a specific date:the_timecan only be used in The Loop.