Remove bbPress forum profile URL link
-
Hi Have tried to remove the link from username with below code but when i use it, the avatar reappears which i managed to get rid of – is there another workaround?
add_filter(‘bbp_before_get_breadcrumb_parse_args’, ‘mycustom_breadcrumb_options’);
add_filter( ‘bbp_get_author_link’, ‘remove_author_links’, 10, 2);
add_filter( ‘bbp_get_reply_author_link’, ‘remove_author_links’, 10, 2);
add_filter( ‘bbp_get_topic_author_link’, ‘remove_author_links’, 10, 2);
function remove_author_links($author_link, $args) {
$author_link = preg_replace(array(‘{<a[^>]*>}’,'{}’), array(” “), $author_link);
return $author_link;
}thanks in advance
Melanie
-
Hi am posting this again as have had no response
Hi Have tried to remove the link from username with below code but when i use it, the avatar reappears which i managed to get rid of – is there another workaround?add_filter(‘bbp_before_get_breadcrumb_parse_args’, ‘mycustom_breadcrumb_options’);
add_filter( ‘bbp_get_author_link’, ‘remove_author_links’, 10, 2);
add_filter( ‘bbp_get_reply_author_link’, ‘remove_author_links’, 10, 2);
add_filter( ‘bbp_get_topic_author_link’, ‘remove_author_links’, 10, 2);
function remove_author_links($author_link, $args) {
$author_link = preg_replace(array(‘{<a[^>]*>}’,'{}’), array(” “), $author_link);
return $author_link;
}thanks in advance
Melaniesorry this support forum is manned by volunteers so we do this in our spare time and for free.
I presume you got this code from
http://www.digitspeak.com/blogging/wordpress/remove-bbpress-forum-profile-url-link/
when you say
the avatar reappears which i managed to get rid of – is there another workaround?
can you explain a bit more about
i managed to get rid of
what did you do?
Hi Robin – I really do appreciate you time and effort, sometimes it is difficult as you want a site to work perfectly and sometimes there is no response so you tend to panic… i apologise for sounding irritated – it was panic as we go live in a few days
in my css i added
.bbp-author-avatar {display: none;}
and worked great, but now i need to remove the link on a users name as i dont want any profiles, this is a simple forum and the users already have a seperate profile page on the site and it would just complicate.. the workaround that i tried to apply (in previous post) mucks up everything, so i just need to know where to go to disable, i have a duplicated bbpress to my child theme so all my changes go there – so i need to know which file contains the info to disable or if the user links have a distinctive class that i can disable
thank you in advance
MelanieYou can either remove the link directly inside your theme files or you can use more CSS to hide the link. Without looking at your site it’s a little difficult to give you exact CSS to use, but it would be along the lines of:
.reply .bbp-reply-author a.bbp-author-name { display:none; }
Hi Lynqoid, am afraid the above does not seem to work, added to my child theme css, then added to bbpress.css.
There must be somewhere in the bbpress.css where i can disactivate, or delete, but for the life of me cant find it!
Do you have any other advice?
thank you
melanieThe above doesn’t work, but that’s because I can’t give you the exact CSS because I can’t see your html, but i’m positive you can hide it with CSS.
Hi ok am reactivating source code – i managed to hide the url, but i dont actually want to do that i want to make it so it doesnt link otherwise you have “started by “. Another idea can i link it to their profile page which is not part of bbpress “http://photohunters.org/photohunters/my-profile/”
site page
http://photohunters.org/photohunters/forum/2nd-hand-market/i really do appreciate your help – am just trying to strip the forum down to the bare minimum
thank you
Melaniejust tested and
add_filter( 'bbp_get_author_link', 'remove_author_links', 10, 2); add_filter( 'bbp_get_reply_author_link', 'remove_author_links', 10, 2); add_filter( 'bbp_get_topic_author_link', 'remove_author_links', 10, 2); function remove_author_links($author_link, $args) { $author_link = preg_replace(array('{<a[^>]*>}','{}'), array(" "), $author_link); return $author_link; } add_filter ('bbp_before_get_author_link_parse_args' , 'rew_remove_avatar' ) ; add_filter ('bbp_before_get_reply_author_link_parse_args' , 'rew_remove_avatar' ) ; add_filter ('bbp_before_get_topic_author_link_parse_args' , 'rew_remove_avatar' ) ; function rew_remove_avatar ($args) { $args['type'] = 'name' ; return $args ; }
seems to do what is required
Oh my god Robin – IT WORKED!! I cant beleive it – amazing – dont know how to thank you, i have been trying to solve the problem for days and you are my saviour!
I thank you from the bottom of my heart – no more panic – am speechless
thank you again
and have a wonderful weekend – whats left of it
Melanieone last thing – am really sorry – how do i hide the “favourite” and “subscribe”?
Melaniegreat – glad it worked.
I’ll come back on favourite/subscribe later !
Thought it was a setting, but was tired when I read the post !
Dashboard>settings>forums>forum features and just untick ‘Allow users to mark topics as favorites’ and ‘Allow users to subscribe to forums and topics’
Wish they were all that simple 🙂
thank you – didnt even think of the dashboard – thank you again
MelanieNo problem !
Something related to this that I wanted to do, ad because I finally found the answer I want to put it here for others to maybe find…
To remove the url link fro all author instances in bbPress but leave the author names intact you can put this in the child theme’s functions.php:
/* Remove link urls from forum author instances... */ add_filter( 'bbp_get_author_link', 'remove_author_links', 10, 2); add_filter( 'bbp_get_reply_author_link', 'remove_author_links', 10, 2); add_filter( 'bbp_get_topic_author_link', 'remove_author_links', 10, 2); function remove_author_links($author_link, $args) { $author_link = preg_replace(array('{<a[^>]*>}','{}'), array(" "), $author_link); return $author_link; }
It was found here: http://www.digitspeak.com/web/wordpress/remove-bbpress-forum-profile-url-link/#comment-440
I inputed Robin W’s code into functions.php in my child theme folder, and it didnt work. Should it go into a different file?
thanksYes, that is where it goes, in functions.php… I can confirm that the code is still working here… Have you cleared caches…?
What can I do if I want to remove the link from last-post author ONLY in the “freshness column” of the Forum Index page and the Single Forum page?
Thank you so much
Use this plugin
https://wordpress.org/plugins/bbp-style-pack/
and go to
dashboard>settings>bbp style pack>freshness display and select what you want
Hi Robin,
I tried the style pack and it doesn’t give me the option UNLINK the author of the last post.
sorry missed the word in caps from your enquiry !
I use this to change default Profile URL (author link) to my custom Profile Page URL.
How can I also change mention links to my custom profile page url?
(bbpress 2.6 RC5)
I hate to resurrect an old thread, but it contains pretty much everything I’d need to reference.
The code posted by @crzyhrse above WORKS — for removing the profile links from author avatars when those authors are replying to a thread in a forum. BRILLIANT!
Now, I’d like to use the same technique/code on the ‘Group Administrator’ avatars.
I want to KEEP the images, the name…just like how the code posted (above) by @crzyhrse works with people in a discussion. For the life of me, though, I can’t seem to figure out how to use that same code to disable the links in ‘Group Administrator’ avatars, while keeping the images and names intact.
Anyone happen to have any ideas?
Here’s the code I’m using…note that the first half is the code that works to shut off links to author profiles PERFECTLY…it’s the second chunk of code that doesn’t seem to affect ‘Group Administrators’ in the same manner.
Here goes:
/* Remove link urls from forum author instances... */ add_filter( 'bbp_get_author_link', 'remove_author_links', 10, 2); add_filter( 'bbp_get_reply_author_link', 'remove_author_links', 10, 2); add_filter( 'bbp_get_topic_author_link', 'remove_author_links', 10, 2); function remove_author_links($author_link, $args) { $author_link = preg_replace(array('{<a[^>]*>}','{}'), array(" "), $author_link); return $author_link; } /* Remove link urls from admin avatars... */ add_filter( 'BBP_Users_Admin_link', 'remove_Users_Admin_links', 10, 2); function remove_Users_Admin_links($Users_Admin_link, $args) { $Users_Admin_link = preg_replace(array('{<a[^>]*>}','{}'), array(" "), $Users_Admin_link); return $Users_Admin_link; }
Thanks in advance for any and all assistance!
Oh wow — I figured it out, nm!! 🙂
You can do it via CSS….like this:
#group-admins { pointer-events: none; cursor: default; text-decoration: none; color: black; }
And in bbPress apparently that is the correct way to write that code; the #group-admins part will likely work for everyone, just as it is, because it appears to be the default name for that.
Whew!
- You must be logged in to reply to this topic.