New answers tagged loop
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( ...
1
vote
Accepted
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 $...
Top 50 recent answers are included
Related Tags
loop × 3313wp-query × 725
custom-post-types × 520
php × 408
posts × 387
categories × 270
pagination × 212
custom-taxonomy × 193
query-posts × 192
theme-development × 161
query × 151
custom-field × 144
functions × 122
customization × 118
pages × 100
templates × 94
advanced-custom-fields × 84
get-posts × 76
plugins × 69
taxonomy × 65
ajax × 63
woocommerce-offtopic × 62
filters × 61
shortcode × 61
page-template × 61