copy wp-include/link-template to child theme

The article you linked to already has a solution written by the co-founder of WordPress Mike Little:

https://digwp.com/2012/05/post-navigation-author-category/#comment-36899

In the spirit of constructive criticism, the correct solution to this
is in two parts:

Firstly, the third parameter to previous_post_link() and
next_post_link() is a flag to say keep the same category. Modify your
theme (probably in single.php) to add that third parameter as true
to both functions.

Next, add the following 5 lines of code to your theme’s functions.php.
That’s it: five lines is all that’s required to do the job properly.

function keep_same_author_get_next_post_where($where, $in_same_cat,
$excluded_categories) {
  global $post;
  return $where .= " AND
p.post_author="" . $post->post_author . """;
}
add_filter('get_next_post_where',
'keep_same_author_get_next_post_where', 10, 3);
add_filter('get_previous_post_where',
'keep_same_author_get_next_post_where', 10, 3);

This solution looks well written and straight forward.

There is a lot of information out there on WordPress and a lot of bad practices being recommended. I’ve left out some of Mikes more colourful comments on the subject but they’re readable if you click through.


To directly answer your bullet points for completeness:

  1. the first question is, Is this even possible?, or I’m I thinking about this the wrong way?

Yes! See previous text in answer for the solution

  1. Can I simply copy the wp-include/link-template.php file to my childtheme (and where?)

No, child themes allow you to override theme templates loaded using the theme templating system. They can’t be used to replace arbitrary files such as JS files or core WP files just by dropping a file with the same name in the child theme and hoping it gets used instead.

I would note that in this situation, the name of the file link-template.php is unfortunate and implies things it should not.

  1. Since I just want to change some functions, should I only have those commands in my link-template.php file in the child theme (instead of the whole one), so the rest can be updated correctly with the wordpress core?

If you ever need to change the behaviour of WordPress core, you should use filters and actions in a plugin or theme. This is also the case for modifying the behaviour of 3rd party plugins. Note that sometimes a filter or action wasn’t added by the authors but there are ways to get around that, and it’s a question that has already been asked on this stack with some very good and detailed answers by myself and others, so I recommend searching for those.