Switch language

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




is_single [ WordPress Function ]

is_single ( $post = '' )
Parameters:
  • (mixed) $post Post ID, title, slug, or array of such.
Uses:
  • $wp_query
See:
Returns:
  • (bool)
Defined at:

Benzer Fonksiyonlar: is_singular, is_ssl, is_page, is_time, list_files


Is the query for a single post?

Works for any post type, except attachments and pages

If the $post parameter is specified, this function will additionally check if the query is for one of the Posts specified.

Source


<?php
function is_single$post '' ) {
    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_single$post );
}
?>

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