WordPress.org

Ready to get started?Download WordPress

Forums

"Page # of #"-like Pagination. (4 posts)

  1. enrique-ramirez
    Member
    Posted 4 years ago #

    I've been looking around to no avail. Anyone know a good way to do a pagination such as this?

    http://enrique-ramirez.com/tmp/screen_shot_2010-08-26_at_4.42.32_pm_2abf.png

    The current code I'm using:

    <?php next_posts_link('<img src="/wp-content/themes/seventhman/images/icons/btn-prev.gif" alt"Previous" />') ?>
    Page <strong>1</strong> of <strong>12</strong>
    <?php previous_posts_link('<img src="/wp-content/themes/seventhman/images/icons/btn-next.gif" alt"PNext" />') ?>

    I need a way to retrieve the page the user currently is, the number of total paginated pages there are and a way to stop this sentence from appearing if there are no pages at all.

    Catch is: can't use a plugin. So if anyone could point me in the right direction for a functions.php function or something, it'd be greatly appreciated.

  2. Hax
    Member
    Posted 4 years ago #

    what is the reason that you can't use a plugin? you can all ways copy the code on the plugin and adde it to your function.php file

  3. enrique-ramirez
    Member
    Posted 4 years ago #

    My main reason is I'm concerned about compatibility. This theme will be installed in some older WP versions, so a generic function could be more suitable.

    Also, asking people to install a plugin can be quite complex for the computer illiterate. I want this as "plug and play" as possible (even though Plugins are already quite simple to install).

    Last resort would be a plugin, but would be way better without one.

  4. Hax
    Member
    Posted 4 years ago #

    what wordpress version are you running?

    wp-pagenavi is very stable http://wordpress.org/extend/plugins/wp-pagenavi/
    you can check the plugin author if it is compatible with the version that your running

    after installing the plugin you can change/add styles to fit your needs. also you should always have a development site to test plugins before you install them.

    If you want to accomplish the navigation with just a function and if you can find anybody that wants to write it for you they need to know what version you are running to make the function compatible.

Topic Closed

This topic has been closed to new replies.

About this Topic