in_category [ WordPress Function ]
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Check if the current post in within any of the given categories.
The given categories are checked against the post's categories' term_ids, names and slugs. Categories given as integers will only be checked against the post's categories' term_ids.
Prior to v2.5 of WordPress, category names were not supported. Prior to v2.7, category slugs were not supported. Prior to v2.7, only one category could be compared: in_category( $single_category ). Prior to v2.7, this function could only be used in the WordPress Loop. As of 2.7, the function can be used anywhere if it is provided a post ID or post object.
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- in_category - WordPress Codex
in_category() considers only the categories a post is directly assigned to (the checked categories in Write/Edit Post panel), not the parents of the assigned ...
codex.wordpress.org - WordPress › Support » is_category() and in_category() not working
in_category() tests to see if a given post has a category in that specific category and must be used in The Loop, but you are trying to figure out what the category ...
wordpress.org - Complex loop with in_category(): Part 1 — studiograsshopper
Sep 18, 2008 ... Magazine themes often use the WP_Query() function to display a specified number of posts, excerpts, titles etc, on the magazine-style home ...
www.studiograsshopper.ch - categories - in_category() works in single.php but not in page.php ...
Aug 8, 2011 ... I'm using in_category(array) inside The Loop to detect whether a post is categorised into the Discussion category (or has one of a couple of ...
wordpress.stackexchange.com
Kullanýcý Tartýþmalarý [ wordpress.org ]
- Amy Hendrix (sabreuse) on "Equivalent to in_category() for custom taxonomy"
- dermotholmes on "Equivalent to in_category() for custom taxonomy"
- Amy Hendrix (sabreuse) on "Equivalent to in_category() for custom taxonomy"
- jvandelaar on "Equivalent to in_category() for custom taxonomy"
- dermotholmes on "Equivalent to in_category() for custom taxonomy"
- jvandelaar on "Equivalent to in_category() for custom taxonomy"
- eric brockman on "Please, Anybody - Custom menus not showing up in posts, only in categories??"
- Rev. Voodoo on "Please, Anybody - Custom menus not showing up in posts, only in categories??"
- eric brockman on "Please, Anybody - Custom menus not showing up in posts, only in categories??"
- Rev. Voodoo on "Please, Anybody - Custom menus not showing up in posts, only in categories??"