Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




is_post_type_archive [ WordPress Function ]

is_post_type_archive ( $post_types = '' )
Parameters:
  • (mixed) $post_types Optional. Post type or array of posts types to check against.
Uses:
  • $wp_query
See:
Returns:
  • (bool)
Defined at:



Is the query for a post type archive page?

Source


<?php
function is_post_type_archive$post_types '' ) {
    global 
$wp_query;

    if ( ! isset( 
$wp_query ) ) {
        
_doing_it_wrong__FUNCTION____'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
        return 
false;
    }

    return 
$wp_query->is_post_type_archive$post_types );
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics