Forum Replies Created
-
In reply to: Adding classes to profile fields
@shanebp good shout!
You can just comment out the line in register.php. So long as you’re just removing text, the registration process won’t be affected.
In reply to: Adding classes to profile fieldsAh I see what you’re trying to do.
$i = '1'; if ( $items = bp_get_profile_field_data( array( 'field' => 'Budget' ) ) ) { foreach ( $items as $item ) { ?> <div id="<?php echo 'size-' . $i; ?>"> <?php echo $item; ?> </div> <?php $i++; ?> <?php } }In reply to: Adding classes to profile fieldsA unique ID is easy enough, just use the loop to output a unique value. e.g.
$i = '1'; if ( $items = bp_get_profile_field_data( array( 'field' => 'Budget' ) ) ) { foreach ( $items as $item ) { ?> <!-- put what you want here --> <?php echo 'item-' . $i; ?> <?php echo $item; ?> <?php $i++; ?> <!-- put what you want here --> <?php } }In reply to: Adding classes to profile fieldsIs budget a field that you’ve set up under WP Admin > Profile Fields? and is it of type ‘checkbox’? also are you displaying the values on the user’s profile page? if yes to all of these then this should work:
if ( $items = bp_get_profile_field_data( array( 'field' => 'Budget' ) ) ) { foreach ( $items as $item ) { ?> <!-- put what you want here --> <?php echo $item; ?> <!-- put what you want here --> <?php } }Note: I’ve amended the code so you can insert HTML a bit easier
In reply to: Adding classes to profile fieldsHi @applegateian – I think the problem might be the snippet you’re using to output the data string.
try doing something like this:
if ( $items = bp_get_member_profile_data( array( 'field' => 'Budget' ) ) ) { foreach ( $items as $item ) { // put whatever you want here echo $item; // put what you want here } }Note: I haven’t tested.
In reply to: Turn avatar into link to profile in an author box@3rdaxis just to note that’ll work on that page only. If you want to link an avatar that’s on a member’s profile page or in the members loop for example you’ll need to use a slightly different way of getting the user’s ID.
In reply to: How to remove "search these" text from search form?You can filter
bp_search_form_type_select.This will be the general idea:
function my_select_filter ( $selection_box ) { // do your filtering here return $selection_box; } add_filter( 'bp_search_form_type_select', 'my_select_filter' );Once you’re done, pop it in your theme’s functions.php file.
In reply to: activity stream goneA child theme of bp-default? Make sure you have copied the files and folders over exactly. So for example:
bp-default/members/single/messages/compose.php
gets copied to
your-child-theme/members/single/messages/compose.php
In reply to: Email after activationYou could also try Welcome Pack by Paul Gibbs – it allows you to send a welcome email and also customise the various more emails BuddyPress sends out:
In reply to: Turn avatar into link to profile in an author box<a href="/members/<?php echo bp_core_get_username( get_the_author_meta( 'ID' ) ); ?>/"> // put your avatar here </a>In reply to: Search for user role@shanebp could the user’s role be assigned programmatically to an xprofile field? That would then be searchable using the standard member search
In reply to: Separate user photo and avatarThis can’t be done using BuddyPress as it comes out of the box. You’d need a plugin or some custom code which allows users to save a image file to their profile data.
In reply to: Turn avatar into link to profile in an author boxJust wrap a
<a href...>around that statement. That will turn the avatar into a link.In reply to: [Resolved] Extra Info in members list.@pelaso as bphelp said, it actually explains how to do that in the members-loop.php template.
In reply to: Using BuddyPress as a Professional Social NetworkAs you say both approaches are valid which makes the choice difficult. A Codex guide on the advantages and disadvantages of each approach would be V useful. I find the attraction with bp-default is it is tried and tested. That said, the template hierarchy allows me to ‘get my house in order’ – everything in my theme that is BP is filed nicely under a community folder which makes good sense for maintenance or development down the line.
I’m sure there are more advantages with each route so a Codex guide on this would certainly be useful to me at least.
In reply to: Applying Default Buddypress Theme to Another ThemeThis can only be explained as a huge job. You would need to know both CSS and HTML to achieve that. I’d suggest reading up on those two technologies if you’re just getting started. Some knowledge of PHP, JS and Ajax would be helpful too although you’d just need to know what parts of the templates are best to avoid messing with.
In reply to: Using BuddyPress as a Professional Social NetworkBuddyPress with the help of the right plugins from the WordPress plugin repository (https://wordpress.org/plugins/) can do everything you’ve mentioned.
11. Projects: Members can start projects and invite other members to join (kind of groups)
This is the one point I’m not sure about off the top of my head. It may need some custom code as I’m not aware of a plugin that does this.
Yes definitely agree with that! especially in this case where loading the theme compat stuff unnecessarily will cause a little extra overhead.
Can I ask – would you take this approach? e.g. still use a child of bp-default? or would you opt to use the new template hierarchy? I have always been an admirer of the bp-default theme (not so much the styles (I dequeue the CSS) but more so the ajax and js that comes with it).
@hnla apologies should have explained that a bit better – i’m not assuming, I think BP does the assuming. Take a look at the last line of Boone’s post:
BP Theme Authors: make sure your theme registers 'buddypress' support
@modemlooper Thanks, I’ll give that a shot but then I may decide not to edit them altogether as they work well already. I could add my own .js elsewhere
@hnla the site I’m working on was built pre BP 1.7 so uses a child theme of bp-default. I thought that BP assumes add_theme_support for bp-default child themes?
In reply to: Tag Cloud – set number of tagsThis snippet is what you need to paste into your file:
<?php wp_tag_cloud( array( 'number' => '8' ) ); ?>If you are already using a tag cloud then find it and remove it. A basic tag cloud will look something like this:
wp_tag_cloud()In reply to: Adding classes to profile fields@applegateian each checkbox should have a unique ‘id’ which you can use to target specific checkboxes.
Do you have a link to your page with the checkboxes on it?
In reply to: Tag Cloud – set number of tagsDo you mean a WordPress tag cloud as in
wp_tag_cloud()?<?php wp_tag_cloud( array( 'number' => '8' ) ); ?>