I am using the_posts_pagination to create my pagination links on Wordpress, however I would like to replace 'prev' and 'next' with Font Awesome icons. Is this possible?

I am already using Font Awesome elsewhere on the site.

Kind regards James

  • Yes it's possible.
    – bravokeyl
    Commented Oct 31, 2016 at 10:43
  • Thanks. Do you know how I can do it?! Commented Oct 31, 2016 at 10:45
  • Added sample code.
    – bravokeyl
    Commented Oct 31, 2016 at 10:45

1 Answer 1


You can change the text with the funcion for example.

the_posts_pagination( array(
        'prev_text' => __( '<i class="fa fa-arrow-left"></i>', 'textdomain' ),
        'next_text' => __( '<i class="fa fa-arrow-right"></i>', 'textdomain' ),
    ) );

Use whatever icons you can, I used fa-arrow icons.

  • Thank you very much for this - it didn't actually work placing it in functions.php but it worked perfectly directly in the page. Commented Oct 31, 2016 at 11:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.