Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #26014

    I just noticed that my in a Portfolio page (not the grid overview but detail page) the Next button on the right of the browser window always refers to the last Portfolio item, not the next in the list. The Previous button does refer to the previous item, though.

    Any idea why?


    Hi DavyE,

    Can we see an example on the site live?




    Sure can, this is the test page of the portfolio grid:

    Click on any item and you’ll see the “Next” button will always refer to the last item in that list.

    And perhaps this problem is also related to what causes it: (Purchase code hidden if logged out) -fullwidth-items


    I think I just figured out why!

    In the past I asked how to sort the portfolio items alphabetically instead of last added. The code below was what I was told to add to the bottom of the functions.php file. Yet, I suspect this does not influence the Next/Previous button, meaning they still refer to the items in last added formation. Perhaps I need to just add a similar code to make them act alphabetically, too?

    function custom_post_grid_query( $query, $params ) {

    $query = ‘title’;

    $query = ‘ASC’;

    return $query;


    add_filter( ‘avia_post_grid_query’, ‘custom_post_grid_query’, 10, 2);

    I did notice another issue, however. In some items the Previous and Next buttons don’t roll out on hover, they stay closed.



    Please remove the code. Use this plugin to order the portfolio items.




    I already have that plugin installed, useful for small lists. This is insane for around 500 (and growing) items. Manually reordering hundreds of items just so they are alphabetical, then I’d rather just disable the previous and next buttons altogether. A shame though, I’d rather keep them.


    Afaik it’s not possible to change the order because we use the standard get_previous_post() and get_next_post() wp functions to output the next/previous posts and there’s no parameter to control the order. Even the “post order” plugin won’t work because WP uses a hardcoded sql query and not WP_Query. This probably will change with WP3.7 ( )

    If you want to remove the next/previous links open up footer.php and delete

    echo avia_post_nav();

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Portfolio "Next" points to last instead of next’ is closed to new replies.