Title: Post Index Helpers
Author: Scott Reilly
Published: <strong>13. septembra 2010</strong>
Last modified: 20. apryla 2025

---

Tykače pytać

![](https://ps.w.org/post-index-helpers/assets/banner-772x250.png?rev=834120)

Tutón tykač **njeje so z najnowšimi 3 hłownymi wersijemi WordPress testował**. Snano
so hižo njewothladuje abo njepodpěruje a ma problemy z kompatibelnosću, hdyž so 
z nowšimi wersijemi WordPress wužiwa.

![](https://ps.w.org/post-index-helpers/assets/icon-128x128.png?rev=973752)

# Post Index Helpers

 Wot [Scott Reilly](https://profiles.wordpress.org/coffee2code/)

[Sćahnyć](https://downloads.wordpress.org/plugin/post-index-helpers.1.4.5.zip)

 * [Podrobnosće](https://hsb.wordpress.org/plugins/post-index-helpers/#description)
 * [Pohódnoćenja](https://hsb.wordpress.org/plugins/post-index-helpers/#reviews)
 *  [Instalacija](https://hsb.wordpress.org/plugins/post-index-helpers/#installation)
 * [Wuwiće](https://hsb.wordpress.org/plugins/post-index-helpers/#developers)

 [Podpěra](https://wordpress.org/support/plugin/post-index-helpers/)

## Wopisanje

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](https://coffee2code.com/wp-plugins/post-index-helpers/)
| [Plugin Directory Page](https://wordpress.org/plugins/post-index-helpers/) | [GitHub](https://github.com/coffee2code/post-index-helpers/)
| [Author Homepage](https://coffee2code.com)

### Developer Documentation

Developer documentation can be found in [DEVELOPER-DOCS.md](https://github.com/coffee2code/post-index-helpers/blob/master/DEVELOPER-DOCS.md).
That documentation covers the numerous template tags provided by the plugin.

As an overview, these are the template tags provided the plugin:

 * `c2c_get_last_index()` : Gets the index number for the last post in the loop 
   listing
 * `c2c_get_post_by_index()` : Get post based on specified index
 * `c2c_get_posts_by_index()` : Get posts based on specified array of indexes
 * `c2c_get_the_index()` : Get the index for the current post
 * `c2c_is_at_index()` : Is the current index at the specified index?
 * `c2c_is_even()` : Is the current post at an even position? (i.e. 0, 2, 4, …)
 * `c2c_is_first()` : Is the current post the first listed post?
 * `c2c_is_last()` : Is the current post the last listed post?
 * `c2c_is_odd()` : Is the current post at an odd position? (i.e. 1, 3, 5, …)
 * `c2c_is_index_within()` : Is the current post (or one at the specified index)
   within the bounds of a specified range?
 * `c2c_is_post_in_loop()` : Is the specified post within the current loop?
 * `c2c_is_valid_index()` : Is the specified index valid?
 * `c2c_the_index()` : Echo the current post’s index

## Instalacija

 1. Install via the built-in WordPress plugin installer. Or download and unzip `post-
    index-helpers.zip` inside the plugins directory for your site (typically `wp-content/
    plugins/`)
 2. Activate the plugin through the ‚Plugins‘ admin menu in WordPress
 3. Use one or more of the provided template tags in theme template file(s) as desired

## Pohódnoćenja

Za tutón tykač pohódnoćenja njejsu.

## Sobuskutkowarjo a wuwiwarjo

„Post Index Helpers“ je softwara wotewrjeneho žórła. Slědowacy ludźo su k tutomu
tykačej přinošowali.

Sobuskutkowarjo

 *   [ Scott Reilly ](https://profiles.wordpress.org/coffee2code/)

[Přełožće „Post Index Helpers“ do swojeje rěče.](https://translate.wordpress.org/projects/wp-plugins/post-index-helpers)

### Na wuwiću zajimowany?

[Přehladajće kod](https://plugins.trac.wordpress.org/browser/post-index-helpers/),
hladajće do [SVN-repozitorija](https://plugins.svn.wordpress.org/post-index-helpers/)
abo abonujće [wuwiwanski protokol](https://plugins.trac.wordpress.org/log/post-index-helpers/)
přez [RSS](https://plugins.trac.wordpress.org/log/post-index-helpers/?limit=100&mode=stop_on_copy&format=rss).

## Protokol změnow

#### 1.4.5 (2025-04-19)

 * Change: Note compatibility through WP 6.8+
 * Change: Note compatibility through PHP 8.3+
 * Change: Update copyright date (2025)
 * Unit tests:
    - Change: Explicitly define return type for overridden methods
    - New: Add `composer.json` for PHPUnit Polyfill dependency (supposed to have
      been added in v1.4.4)

#### 1.4.4 (2024-08-10)

 * Change: Note compatibility through WP 6.6+
 * Change: Update copyright date (2024)
 * New: Add `.gitignore` file
 * Change: Reduce number of ‚Tags‘ from `readme.txt`
 * Change: Remove development and testing-related files from release packaging
 * Unit tests:
    - Hardening: Prevent direct web access to `bootstrap.php`
    - Allow tests to run against current versions of WordPress
    - New: Add `composer.json` for PHPUnit Polyfill dependency
    - Change: In bootstrap, store path to plugin directory in a constant

#### 1.4.3 (2023-04-29)

 * Change: Note compatibility through WP 6.3+
 * Change: Update copyright date (2023)
 * Fix: Fix typo for link to DEVELOPER-DOCS.md in README.md

_Full changelog is available in [CHANGELOG.md](https://github.com/coffee2code/post-index-helpers/blob/master/CHANGELOG.md)._

## Meta

 *  Version **1.4.5**
 *  Last updated **2 lěće**
 *  Active installations **10+**
 *  WordPress version ** 2.8 abo nowši **
 *  Tested up to **6.8.12**
 *  Language
 * [English (US)](https://wordpress.org/plugins/post-index-helpers/)
 * Tags
 * [index](https://hsb.wordpress.org/plugins/tags/index/)[loop](https://hsb.wordpress.org/plugins/tags/loop/)
   [position](https://hsb.wordpress.org/plugins/tags/position/)[post](https://hsb.wordpress.org/plugins/tags/post/)
   [template tags](https://hsb.wordpress.org/plugins/tags/template-tags/)
 *  [Rozšěrjeny napohlad](https://hsb.wordpress.org/plugins/post-index-helpers/advanced/)

## Pohódnoćenja

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/post-index-helpers/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/post-index-helpers/reviews/)

## Sobuskutkowarjo

 *   [ Scott Reilly ](https://profiles.wordpress.org/coffee2code/)

## Podpěra

Chceće něšto prajić? Trjebaće pomoc?

 [Forum pomocy pokazać](https://wordpress.org/support/plugin/post-index-helpers/)

## Darić

Chceće dalewuwiwanje tutoho tykača podpěrać?

 [ Za tutón tykač darić ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6ARCFJ9TX3522)