Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Check for taxonomy archive results on search.php page › Reply To: Check for taxonomy archive results on search.php page
May 11, 2020 at 12:21 pm
#27222
Keymaster
Hi Niels,
Well, you cannot check that via WordPress core functions, as all of those items there are “mimiced” as post types, since the results page is built for that.
There might be a way though, via using the get_asp_result_field() function in there. Try:
if ( get_asp_result_field('content_type') == 'term' ) {
The “content_type” field should contain the result type – in this case you are looking for “term”, that represents taxonomy terms (taxonomy archive links).