is_category [ WordPress Function ]
is_category ( $category = '' )
| Parameters: |
|
| Uses: |
|
| See: |
|
| Returns: |
|
| Defined at: |
|
Is the query for a category archive page?
If the $category parameter is specified, this function will additionally check if the query is for one of the categories specified.
Source
<?php
function is_category( $category = '' ) {
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_category( $category );
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- is_category() - WordPress Codex
Description. This Conditional Tag checks if a Category archive page is being displayed. This is a boolean function, meaning it returns either TRUE or FALSE.
codex.wordpress.org - Conditional Tags « WordPress Codex
is_category(): When any Category archive page is being displayed. is_category( ' 9' ): When the archive page for Category 9 is being displayed. is_category( ...
codex.wordpress.org - WordPress › Support » Tags — is_category
(forgot?) Register · WordPress › Support » is_category. 123Next ...
wordpress.org - WordPress › Support » is_category() and in_category() not working
Hello,. Having some problems with what seems like a simple conditional statement. On single.php pages, I'm trying to call in different versions of the loop based ...
wordpress.org
Gebruikersdiscussies [ wordpress.org ]
- willx on "is_category() and is_tag() : how to get the category then"
- alchymyth on "is_category() and is_tag() : how to get the category then"
- willx on "is_category() and is_tag() : how to get the category then"
- dbcuadro on "Thesis / using is_category in custom_functions not working"
- clegeard on "Thesis / using is_category in custom_functions not working"
- Julson on "is_category / in_category -> echo value from array"
- vtxyzzy on "is_category / in_category -> echo value from array"
- Julson on "is_category / in_category -> echo value from array"
- ParadoxDev on "If is_category issues"
- esmi on "Thesis / using is_category in custom_functions not working"