Link Author to BuddyPress

Posted in: Newspaper
Post count: 6

Hi,

I have created a child theme and have attempted to link the author to their BuddyPress page rather than their author page.

It is as simple as changing the following on line 125 of themes/Newspaper/includes/wp_booster/td_module.php

... get_author_posts_url($this->post->post_author) ...

Can be changed to the following:

... bp_core_get_user_domain($this->post->post_author) ...

Unfortunately, overriding the parent function does not seem to work as expected. I notice that the function get_author() is wrapped in an abstract class called td_module()

I know that you have suggested 301 redirects to accomplish this, but that seems like a very messy solution that will put unnecessary burden on the server. Also, 301 redirects are a poor SEO practice.

Is there a way to extend the td_module() class and then implement a function override for get_author() ?

Thank you for the excellent theme!

Post count: 22421

Hello,

Sorry but td_module will not work from the child theme. There are only a few files from the wp-booster functions that will work from the child theme. You will have to make this modification in the main theme.

Thank you!

Post count: 6

That is what I suspected. Thanks for getting back to me so promptly!

Post count: 6

For future posters who may want to link the user link on the top bar to the user’s buddypress account, it is a very easy change.

Follow the instructions for Headers on this page about child theming for Newspaper: https://forum.tagdiv.com/the-child-theme-support-tutorial/

Then, on line 52 of top-menu.php change the following code:

... get_author_posts_url($current_user->ID) ...

to the following:

... bp_core_get_user_domain($current_user->ID) ...

Now the user links to their BuddyPress profile instead of their author page.

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.