Page Builders are not be compatible with BuddyPress (at least, I don’t know of any support).
You would need to manually edit the template files. If you know basic CSS/HTML/PHP, I can give you some instructions and link to some docs.
Hi Paul
Sounds great. Yes i know how to some basic HTML and CSS – not very good at PHP. But where would i have to edit this file? Am i right if its in the child theme, so it won’t be overwritten when i update?
See my comment. Forgot to do it as a reply.
Go to /wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/
. The four files — activate
, index
, members-loop
, and register
— are templates used for the Members Directory. Ignore the single
subfolder; that’s used for individual member pages.
You will want the index.php
file.
In your theme, create a buddypress/members
subfolder. e.g. /wp-content/themes/my-theme/buddypress/members/
. You’ll need to create both directories if they’re missing. Copy that index.php
we found earlier into this new directory.
e.g. you’ll end up with /wp-content/themes/my-theme/buddypress/members/index.php
. You’ll want to play around in this file to find where you want to add your custom CSS, which I’ll leave to you to figure out.
Hi Paul
Thanks a lot for your help. 🙂
I tried your suggestion, however the members directory look now changed. However i was able to insert my html/css, so that is good. What would i have to do in order to keep the look it was before and still be able to insert my html/css? I tried just inserting my html in the original folder, but it doesn’t seem to show.
You might be running a theme with BuddyPress-specific files. Have a hunt around your theme, look for a similar structure. etc
Hi Paul
You’ve been a great help!
I managed to find the correct buddypress index file.
If it isn’t too much I would like your help to one last thing.
So i created my div, however i want it to be visible to only the administrator.
I found a code i can use:
<?php
if (current_user_can(‘edit_users’)){
?>
<div class="opretbruger">Opret bruger</div>
<?php
}
?>
however it doesn’t seem to work – it simply hides the div for every user even though my administrator role has the right to edit users. I also tried with ‘administrator’. Am i doing anything wrong?
Nice work! That looks like it ought to work. Assuming you’re logged in. Assuming that user has that capability.
Have you tried adding text or something just output that PHP block, to double-check your edited template is actually being used? You might be touching the wrong file.
Failing that, it might be output, but just hidden by your theme’s CSS? Have you checked for this element inside the web browser’s inspector tools, have you found it?
Alternatively, you could use this code, but I don’t see why it would make any difference:
<?php if ( is_super_admin() ) : ?>
<div>hello world</div>
<?php endif; ?>
^ That slightly different syntax for PHP in these template files (note the {}
are gone) makes the file slightly more readable/less prone to be accidentally broken.
Paul you are the man!
I have no idea either why that would work, however it did!
Thank you so much for your help.