|
|
View previous topic
::
View next topic
|
Author |
Message |
ramon fincken Site's programmer
 Get a free globally recognized avatar It's free!
Joined: 03 Aug 2007 Posts: 412 Location: A'dam/Diemen, The Netherlands
|
Posted: Sun Oct 19, 2008 12:23 pm Post subject: [wordpress] Templates and the “is” Functions |
|
|
WordPress 1.3 introduces the “is” series of template functions. These tell you what type of page is being requested. For example, is_home() is true if the home page is being requested. is_category() is true if a category is being requested. Here is the full list of “is” functions and the requests for which they are true.
- is_home() - The front page
- is_single() - A single post
- is_page() - A static/standalone page
- is_category() - A category
- is_author() - An author
- is_date() - A year, month, or day
- is_year() - A year
- is_month() - A month
- is_day() - A day
- is_time() - An hour, minute, or second
- is_archive() - A category, author, or date
- is_search() - A search
- is_404() - A 404 page
- is_feed() - A syndication feed
Further, is_single(), is_page(), is_category(), and is_author() can accept an id, name, or nicename. Here are some examples using is_page().
- is_page() - True if a page is being served.
- is_page(3) - True if a page with the ID of 3 is being served.
- is_page(’About Me’) - True if the page title is ‘About Me’.
- is_page(’about-me’) - True if the page nicename is ‘about-me’.
Read on / Source:
http://boren.nu/archives/2004/11/10/ana...ess-theme/ |
|
Back to top |
|
 |
Google adsense Advertisement
|
Posted: Sun Oct 19, 2008 12:23 pm Post subject: [wordpress] Templates and the “is” Functions |
|
|
Advertisement
|
|
Back to top |
|
 |
GravityForms Advertisement
|
Posted: Sun Oct 19, 2008 12:23 pm Post subject: [wordpress] Templates and the “is” Functions |
|
|
Advertisement
 |
|
Back to top |
|
 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|