How to change the default URL of PublishPress Authors from "author" to "members"?

230 Views Asked by At

On a WordPress website I'm using BuddyBoss theme and I've added a glossary plugin.

I'm trying to add a Author Box to under each glossary term, to let site visitors visit the profile of its author. To do this, I've installed a plugin called PublishPress which almost does the job but by default the profile URLs leads to the person's author profile https://example.com/author/hisname/ which should be https://example.com/members/hisname/.

By googling I found a similar solution for another theme:

// FUNCTION
// Change Post's Author URL to Buddypress Profile URL
add_filter('generate_post_author_output','generate_post_author_output_buddyprss_url');

function generate_post_author_output_buddyprss_url( $post_author_profile_link ){
$post_author_profile_link = sprintf( ' <span class="byline">%1$s</span>',
            sprintf( '<span class="author vcard" itemtype="http://schema.org/Person" itemscope="itemscope" itemprop="author">%1$s <a class="url fn n" href="%2$s" title="%3$s" rel="author" itemprop="url"><span class="author-name" itemprop="name">%4$s</span></a></span>',
                __( 'by','generatepress'),
                esc_url( bp_core_get_user_domain( get_the_author_meta( 'ID' ) ) ),
                esc_attr( sprintf( __( 'Know more about %s', 'generatepress' ), get_the_author() ) ),
                esc_html( get_the_author() )
            )
        ) ;
return  $post_author_profile_link;

}

I'm wondering how can I customize the script in order to do the exact job. To be honest I'm totally screwed up. Thanks for any help!

1

There are 1 best solutions below

0
On

I fixed the issue by the pro version of the PublishPress Authors. In the pro version there's a possibility to edit the layout and there's a property returning the BuddyPress Profile Link.

<a href="{{ author.buddypress_profile_link }}"...

instead of:

<a href="{{ author.link }}"...