You are doing it wrong
-
You should translate the HTML string, not the function
-
When passing strings into functions, like what you are doing, you should use
__()
which returns the translated string._e()
would echo the string and you would get the raw text and the modified text on outputExample of correct usage:
get_next_posts_link( __( 'Older posts' ), $the_query->max_num_pages );
or
next_posts_link( __( 'Older posts' ), $the_query->max_num_pages );
-
_e()
echos a string, so doing the followingnext_posts_link( _e( 'Older posts' ), $the_query->max_num_pages );
would be wrong as you would get the following output
Older postsNext Page »
instead of
Older posts
-
Instead of doing
echo get_next_posts_link()
, you can just donext_posts_link()
.next_posts_link()
is just a wrapper forecho get_next_posts_link()