New answers tagged custom-post-type-archives
3
votes
Accepted
Array_search ignoring the first element
In PHP, the number 0 is interpreted as false-ish.
Your if-statement asks for a true-ish condition like this:
If the result of the array_search function is interpreted as true-ish, THEN do the stuff
...
Top 50 recent answers are included
Related Tags
custom-post-type-archives × 420custom-post-types × 279
custom-taxonomy × 88
archives × 87
archive-template × 37
permalinks × 29
wp-query × 26
categories × 21
pagination × 20
url-rewriting × 19
php × 16
loop × 14
templates × 13
page-template × 13
taxonomy × 12
rewrite-rules × 11
menus × 10
functions × 9
terms × 9
pre-get-posts × 9
template-hierarchy × 9
plugins × 8
plugin-development × 7
posts × 7
theme-development × 7