get_the_post_navigation()
function is defined inside wp-includes/link-template.php
How can I override it in my theme?
get_the_post_navigation()
function is defined inside wp-includes/link-template.php
How can I override it in my theme?
You must be logged in to post a comment.
get_the_post_navigation
does not utilize any filters so there is no easy way to modify or override all of its output.While
get_the_post_navigation
does not apply any filter itself, it does call functions that do apply filter. Specificallyget_adjacent_post_link
:Hooking into that filter will allow you to override some, but not all, of the output.
get_the_post_navigation
also uses_navigation_markup
which does not apply any filters. That portion of the output cannot be overridden.You could request that a filter be added to that function. It would be a simple update and it would enable you to override all of the output.
An easier solution might just be to create your own post navigation function, and then replace all references to
get_the_post_navigation
in your theme with your function.