is_post_type_archive is false when I pass GET parameters in the URL

by csaborio   Last Updated August 14, 2019 07:08 AM - source

So I am modifying the main query and basically asking:

if is_post_type_archive('event') {

This evaluates to true if the URL is:


But is false when I have a get parameter:


I am sure this code was working before and now it's giving me false when I include the GET...any pointers are greatly appreciated.

Answers 1

My fault, I had defined the slug as 'events', hence I should have used:


August 14, 2019 06:01 AM

Related Questions

DIVI Page Builder using Advanced Custom Fields PRO

Updated January 03, 2018 21:08 PM

Help with Multi Level Category Archive Page

Updated August 13, 2016 08:03 AM

Custom Post Archive is not working

Updated September 28, 2017 20:08 PM

Custom post type meta box field won't save

Updated September 06, 2017 18:08 PM