Pre Get Posts – Difference between conditional() and $query->conditional()?

There’s a big difference… most of the times. is_home(), just like any other conditional tag, check main query. $query->condition() check the query object that is passed by action, that can be a a completely different query, because pre_get_posts is called for all queries. As example, let’s assume you are viewing a singular post, and inside … Read more

Three variables on conditional tags

Your conditional, is_category() is wrong here. is_category() checks whether or not you are actually on a category page. By using the ! operator in conjuction with is_category() and ID 1293, this part of the condition will always return true except when you are actually on the category page for category 1293. If you need to … Read more

page single conditional

Your first code sample didn’t work because the elseif had no condition. elseif is a concatenation of else and if: if ( something ) { } elseif ( something else ) { } else { } Or <?php if ( something ): ?> <?php elseif ( something else ): ?> <?php else: ?> <?php endif; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)