I’m quite new to WordPress development. I’m using WordPress 4.9.2. I’m currently working on the following issue. I have several blog categories which have no relation to each other. For example “Our Services” and “News”. Now I want to make sure that the Prev/Next links on each post page are only pointing to Prev/Next within the same category. This should apply for links on the page and for rel links in the head section. I figured already that I JUST have to set the flag $in_same_term to true. For the links at the end of the post, I solved the problem already inside my theme by adding correct args. Only the rel links in the head section are not working like this.
Needed change for header
From
function adjacent_posts_rel_link_wp_head() {
if ( ! is_single() || is_attachment() ) {
return;
}
adjacent_posts_rel_link();
}
To
function adjacent_posts_rel_link_wp_head() {
if ( ! is_single() || is_attachment() ) {
return;
}
adjacent_posts_rel_link('%title', true); //TODO find a better way
}
I just don’t want to touch a WordPress core file. Could anyone help and guide me through the correct process, please?