Zen-Dreams

Zen-Dreams.com

[Wordpress] Index pagination plugin

  • Français

Index pagination plug-in was written with the objective to provide your blog with pagination on your main index page as can be seen in this blog.

In order to install the plug-in, just download this archive into your wp-content/plugins folder, unzip it and then activate it using wordpress administration panel.

Once you did that, you just have to edit your theme’s index.php file and add the following code where you want to display the page list :

<?php if (function_exists ('index_pagination')) index_pagination(); ?>

After doing this, you just have to define the css classes to display the page list as you like.
Default class names for pagination are :

  • pagination => Default classname for the ul element that will display the list.
  • pagination_el => Default classname il for page elements
  • pagination_selected => Default classname for currently selected page.

One important this to know about this plug-in is the parameter list that can be used when calling the function.
index_pagination function takes a maximum of 6 parameters, listed below :

  1. nb_before => Number of elements to display before currently selected page (if any), default value:3
  2. nb_after =>Number of elements to display after currently selected page (if any), default value:3.
  3. sep => Separator text, default value : “…”
  4. list_class => Css class name to use for ul element (default: pagination)
  5. default_class => Css class name for elements within the list (default: pagination_el)
  6. selected_class => Css class name for currently selected page (default: pagination_selected)

In the end, it may look like this (depending of your css code) :

By Anthony

One Trackback

  1. [...] Plugin Pagination – Envie de changer des billets précédents et billets suivants pour afficher en plus le nombre de pages restant à parcourir sur votre blog WordPress ? Ce plugin est fait pour vous. La documentation aussi Ne semble pas fonctionner avec la page de recherche (search.php) ou d’archives : le nombre de pages affichées reste identique quelque soit le nombre de résultat. [...]

Post a Comment

Your email is never shared. Required fields are marked *

*
*