Dropdown pagination (6 posts)

  1. zefdesign
    Posted 6 years ago #

    I am looking to re create the effect seen here: http://www.underconsideration.com/brandnew/

    Alongside the archive pages "next page" & "previous page" I want a drop down box that displays all the possible page numbers of the archive AND a page x of xx text.

    There has to be a way of doing this but I can't find anything on google.

    Thanks so much guys.

  2. vtxyzzy
    Posted 6 years ago #

    I have written a sample function that works in the default theme with default permalinks. You can download it here.

    It may work with pretty permalinks, but has not been tested that way.

    You will probably need to tweak the classes and add some CSS to get it to display the way you want.

    Feedback is welcome. Email m_a_mcdonald =at= bellsouth =dot= net.

  3. vtxyzzy
    Posted 6 years ago #

    The version posted above does NOT work with pretty permalinks. I am working on a version that will. Stay tuned.

  4. Mark / t31os

    Posted 6 years ago #

    Why the regex on the prev/next links ? ... shouldn't this just be a standalone script that runs alongside the existing links?

    Non-regex version that works with and without permalinks.

    Only catch is the URLs are based on the main page, ie. example.com , example.com/page/1 (or example.com?paged=1).

    With a few adjustments it could work for other pages(like archives) to..

    vtxyzzy you're welcome to hack up(or ignore) my code, it's just to illustrate how i'd go about it, so take what you will from it... ;)

  5. vtxyzzy
    Posted 6 years ago #

    I used the regex for the (probably unlikely) case that some other plugin or function would be adding additional parameters to the URL.

  6. vtxyzzy
    Posted 6 years ago #

    The code has been extensively reworked to incorporate pretty permalinks. It has been tested with the default theme in index.php, archive.php, and in a page template. Each of these was tested with the default permalinks and pretty permalinks.

    You can get an updated copy here.

    @t31os_, the case of additional parameters was not so unlikely. Both the archive.php and the page template had them when using the default permalinks.

Topic Closed

This topic has been closed to new replies.

About this Topic