最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

custom post types - is_post_type_archive is false when I pass GET parameters in the URL

programmeradmin0浏览0评论

So I am modifying the main query and basically asking:

if is_post_type_archive('event') {

This evaluates to true if the URL is:

http://localhost:8886/jeanmonnetprojects.au/event

But is false when I have a get parameter:

http://localhost:8886/jeanmonnetprojects.au/event?category=categoryX

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.

So I am modifying the main query and basically asking:

if is_post_type_archive('event') {

This evaluates to true if the URL is:

http://localhost:8886/jeanmonnetprojects.au/event

But is false when I have a get parameter:

http://localhost:8886/jeanmonnetprojects.au/event?category=categoryX

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.

Share Improve this question asked Aug 14, 2019 at 5:43 csaboriocsaborio 1122 silver badges13 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

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

http://localhost:8886/jeanmonnetprojects.au/events?category=categoryX

发布评论

评论列表(0)

  1. 暂无评论