wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
is_singular [ WordPress Function ]
is_singular ( $post_types = '' )
| Parameter: |
|
| Nutzt: |
|
| Siehe: |
|
| Gibt zurück: |
|
| Definiert in: |
|
Is the query for a single post of any post type (post, attachment, page, ... )?
If the $post_types parameter is specified, this function will additionally check if the query is for one of the Posts Types specified.
Source
<?php
function is_singular( $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_singular( $post_types );
}
?>
Beispiele [ wp-snippets.com ]
Top Google Suchergebnisse
- is_singular() - WordPress Codex
<?php is_singular( $post_types ); ?> ... <?php if ( is_singular() ) { // show adv. #1 } else { // show adv. #2 } ?> ... is_singular() is located in wp-includes/query.php .
codex.wordpress.org - Conditional Tags « WordPress Codex
is_singular(): When any of the following return true: is_single(), is_page() or is_attachment(). is_singular( 'book' ): True when viewing a post of the Custom Post ...
codex.wordpress.org - The Difference Between is_singular() and is_single() | Digging into ...
Oct 25, 2009 ... You know that you can target single-view pages with the conditional tag, is_single(): This is a great way to conditionally apply styles, scripts, ...
digwp.com - #10454 (Add .is_singular method to matrices) – Sage
Some approaches to teaching linear algebra define nonsingular matrices before broaching matrix invertibility. This will just add is_singular, with some changes ...
trac.sagemath.org
Nutzerduskussionen [ wordpress.org ]
- esmi on "is_page usage within the loop"
- yoav.aner on "is_page usage within the loop"
- esmi on "is_page usage within the loop"
- yoav.aner on "is_page usage within the loop"
- Chuck Reynolds on "How to check for custom post type and if it's hierarchical"
- Helen Hou-Sandi on "How to check for custom post type and if it's hierarchical"
- Chuck Reynolds on "How to check for custom post type and if it's hierarchical"
- John James Jacoby on "How to check for custom post type and if it's hierarchical"
- norcross on "How to check for custom post type and if it's hierarchical"
- Chuck Reynolds on "How to check for custom post type and if it's hierarchical"