Okay
  Public Ticket #2745231
Change direction of prev-next navigation in portfolio single page
Closed

Comments

  •  26
    Sira started the conversation

    Hi, guys:

    My client ask me to change the action of the prev-next arrows, so the right arrow call "Next" leads you to the next older project (instead of a newer one), and the left arros call "Previous" leads you to the next newer project. Change the direction of the arrows...

    Is it possible?

    Thanks and best regards,

    Sira

  •  1,558
    Laborator replied

    Hi Sira,

    They are correct and in the way that WordPress require, so when you click Next it goes to a newer item, when you click previous it goes to an old one. It's the WordPress logic and there is not an option to revert them.


    Best regards,
    Laborator Team


      Documentation         Join Kalium Users Group

  •  26
    Sira replied

    Hi, Art:

    Then just changing PHP? (wich is not a easy option for me lol)

    Can't I change with CSS the right Next button to appear on the left, and also move the Previous button to the right?

    Thaks again!

    Sira

  • [deleted] replied

    Hi Sira,

    On our old theme versions, it was the way you are saying but we have changed that behavior because a lot of users wanted the default one that WordPress offers. You can see that other WordPress themes have the same logic too.

    Anyway, If you want to reverse their order, then:

    Please go to Appearance > Editor > and make sure that Theme Functions (functions.php) file is selected.

    Then at the end of the current codes please add this PHP code:

    add_filter( 'kalium_adjacent_post_link_args', function ( $args ) {
       $args['prev'] = ! $args['prev'];
       $args['next'] = ! $args['prev'];
       return $args;
    } );

    Have a nice day!

  •  26
    Sira replied

    Thanks, Ylli: 

    It worked perfectly, I added it in the functions.php file of the Theme Child :)

    Have a nice day,

    Sira

  • [deleted] replied

    Happy to hear thatsmile.png

    Have a nice day!

    I will set this ticket as solved from here.