Finding out if you are on a custom post type archive page

To find out if you are on an custom post type archive page I find that the following functions can be useful. We get the query vars with get_query_var() for the post_type and then also check if we are on an archive with is_archive(). These two functions enqueue the Gravity Forms javascript and then embed the form in the archive page for media releases.

This form will only show on page 1 of the media releases custom post type archives.

 

Articles in this section

Like what you see?

Find out how we can build a champion website for you.

Call Nuttify today 1300 688 4391300 688 439
or send us a message
No comments yet.

Leave a Reply