New answers tagged

0 votes

Unexpected warning message to my WordPress posts which group and listed out by year

The issue is here: if($year !== $year_check){ The first time that conditional is used in the loop - $year_check has not been defined. The solution is to simply define it before this: <?php if( ...
shanebp's user avatar
  • 5,048
1 vote

Different date time in results of search

All the date functions reference the global $post variable, but from your code the $post variable is not being used, so that's why the date is wrong. Try this (untested): foreach ( $total_results as $...
Caleb's user avatar
  • 1,725

Top 50 recent answers are included