WordPress Query API
The query API attempts to get which part of WordPress to the user is on. It also provides functionality to getting URL query information.
Class | Description |
---|---|
![]() |
The WordPress Query class. |
Retrieve the currently-queried object. Wrapper for $wp_query->get_queried_object()
Retrieve ID of the current queried object. Wrapper for $wp_query->get_queried_object_id()
Retrieve variable in the WP_Query class.
Whether there are comments to loop over.
Whether current WordPress query has results to loop over.
Whether the caller is in the Loop.
Is the query a 404 (returns no results)?
Is the query for an archive page?
Month, Year, Category, Author, Post Type archive...
Is the query for an attachment page?
Is the query for an author archive page?
If the $author parameter is specified, this function will additionally check if the query is for one of the authors specified.
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.
Whether the current URL is within the comments popup window.
Is the query for a comments feed?
Is the query for a date archive?
Is the query for a day archive?
Is the query for a feed?
Is the query for the front page of the site?
This is for what is displayed at your site's main URL.
Depends on the site's "Front page displays" Reading Settings 'show_on_front' and 'page_on_front'.
If you set a static page for the front page of your site, this function will return true when viewing that page.
Otherwise the same as @see is_home()
Is the query for the blog homepage?
This is the page which shows the time based blog content of your site.
Depends on the site's "Front page displays" Reading Settings 'show_on_front' and 'page_for_posts'.
If you set a static page for the front page of your site, this function will return true only on the page you set as the "Posts page".
Is the query for a month archive?
Is the query for a single page?
If the $page parameter is specified, this function will additionally check if the query is for one of the pages specified.
Is the query for paged result and not for the first page?
Is the query for a post type archive page?
Is the query for a post or page preview?
Is the query for the robots file?
Is the query for a search?
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.
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.
Is the query for a tag archive page?
If the $tag parameter is specified, this function will additionally check if the query is for one of the tags specified.
Is the query for a taxonomy archive page?
If the $taxonomy parameter is specified, this function will additionally check if the query is for that specific $taxonomy.
If the $term parameter is specified in addition to the $taxonomy parameter, this function will additionally check if the query is for one of the terms specified.
Is the query for a specific time?
Is the query for a trackback endpoint call?
Is the query for a specific year?
Set up The Loop with query parameters.
This will override the current WordPress Loop and shouldn't be used more than once. This must not be used within the WordPress Loop.
Rewind the loop posts.
Set up global post data.
Set query variable.
Iterate comment index in the comment loop.
Iterate the post index in the loop.
Redirect old slugs to the correct permalink.
Attempts to find the current slug from the past slugs.
After looping through a separate query, this function restores the $post global to the current post in the main query
Destroy the previous query and set up a new query.
This should be used after query_posts() and before another query_posts(). This will remove obscure bugs that occur when the previous wp_query object is not destroyed properly before another is set up.
Documentation generated on Thu, 29 Sep 2011 01:44:46 +0530 by phpDocumentor 1.4.3