I have two custom post type name as ‘product’ and ‘blog’. And I have also two archive page ‘archive-product.php’ and ‘archive-blog.php’.
Now, I want to know which archive page is active.
Example: We know
is_page('contact') if page is contact then it return true. But what about archive pages. I’ve used
is_archive('blog'), but this function always returns true on both product archive or blog archive active.
So is there any way to know is this archive page ‘product’ or ‘blog’ is active
Read more here: How to know which archive page is active