=== Post Index Helpers === Contributors: coffee2code Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6ARCFJ9TX3522 Tags: post, index, position, loop, template tags, conditional, coffee2code License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Requires at least: 2.8 Tested up to: 4.1 Stable tag: 1.2.2 A variety of template tags related to the index/position of a post within a loop's listing of posts. == Description == This plugin provides thirteen handy template tags that relate to the index/position of a post within a loop's listing of posts. Some of the template tags provided by this plugin relate to the position of the current post within the current loop: * `c2c_is_first()` * `c2c_is_last()` * `c2c_is_at_index()` * `c2c_is_even()` * `c2c_is_odd()` * `c2c_get_the_index()` * `c2c_is_index_within()` * `c2c_the_index()` Other functions help you get a post (or posts) at a given position in the current loop: * `c2c_get_post_by_index()` * `c2c_get_posts_by_index()` While the remaining three functions relate to index information about the loop in general: * `c2c_get_last_index()` * `c2c_is_post_in_loop()` * `c2c_is_valid_index()` Please see the Template Tags section (in some places found under the Other Notes section) for descriptions of all the functions and their arguments. Note that index counting begins at 0, which means the first item has an index of 0. An index of -1 indicates no posts were found. Links: [Plugin Homepage](http://coffee2code.com/wp-plugins/post-index-helpers/) | [Plugin Directory Page](https://wordpress.org/plugins/post-index-helpers/) | [Author Homepage](http://coffee2code.com) == Installation == 1. Unzip `post-index-helpers.zip` inside the `/wp-content/plugins/` directory (or install via the built-in WordPress plugin installer) 1. Activate the plugin through the 'Plugins' admin menu in WordPress 1. Use one or more of the provided template tags in theme template file(s) as desired == Template Tags == The plugin provides thirteen template tags for use in your theme templates. = Functions = * `` Gets the index number for the last post in the loop listing * `` Get post based on specified index * `` Get posts based on specified array of indexes * `` Get the index for the current post * `` Is the current index at the specified index? * `` Is the current post at an even position? (i.e. 0, 2, 4, ...) * `` Is the current post the first listed post? * `` Is the current post the last listed post? * `` Is the current post at an odd position? (i.e. 1, 3, 5, ...) * `` Is the current post (or one at the specified index) within the bounds of a specified range? * `` Is the specified post within the current loop? * `` Is the specified index valid? Validity is defined as being within the range of indexes actively occupied by posts in the current loop listing. * `` Echo the current post's index = Arguments = * `$index` Integer value representing an index. * `$indexes` Array of integer values representing indexes. * `$wp_query` (optional) A custom WP_Query object. If null or not defined, then the global wp_query object is used. (Specifying this is not typical.) * `$start_index` Integer value representing the index at the start of the range (value is inclusive) * `$end_index` Integer value representing the index at the end of the range (value is inclusive) * `$post_id` Integer value representing the ID of the post. = Examples = * Only show thumbnail for the first listed post. `