Answers for "wp check if template archive"

PHP
1

wordpress is_archive

// Returns true if wordpress is on an archive page
is_archive(); // For posts only
is_post_type_archive( $post_types ); // For a specific post type
// example: if (is_post_type_archive( 'news' )){ /* */ }
Posted by: Guest on October-21-2020

Browse Popular Code Answers by Language