Forum Replies Created
-
Okay – I went and replaced the members-loop.php with a fresh copy, made the changes again and now it works.
Who knows. Thanks much!
Okay – so I have this
<?php if ( bp_has_members( bp_ajax_querystring( ‘members’ ).’&type=alphabetical’ ) ) : ?>
in the members-loop.php file and it sorts the users alphabetically by user name.
BUT if I put this:
function alphabetize_by_last_name( $bp_user_query ) { if ( 'alphabetical' == $bp_user_query->query_vars['type'] ) $bp_user_query->uid_clauses['orderby'] = "ORDER BY substring_index(u.display_name, ' ', -1)"; } add_action ( 'bp_pre_user_query', 'alphabetize_by_last_name' );
into the functions.php file I get this error message after it returns one user:
Fatal error: Call to undefined function bp_member_alphabetical() in /home/homepatr/public_html/wp-content/themes/twentyfourteen-child/buddypress/members/members-loop.php on line 57
And here is a copy of line 57:
<div class="item-meta"><span class="activity"><?php bp_member_alphabetical(); ?></span></div>
I’m just a homeschool mom/volunteer trying to get our support group web site up the way we need it. This is definitely a learning experience for me, and I appreciate all the help!
I used the code editor in my cpanel. It shows the first user but under that is this error message: Fatal error: Call to undefined function bp_member_alphabetical() in …..wp-content/themes/twentyfourteen-child/buddypress/members/members-loop.php on line 57
Here’s line 57-
bp_member_alphabetical(); ?><
Did I list that correctly this time? Thanks for your patience. This is a steep learning curve for me.
Okay, I successfully created the child theme, but when I added the above code, I got error messages.
I have this code in my members-loop.php file:
<?php if ( bp_has_members( bp_ajax_querystring( ‘members’ ).’&type=alphabetical’ ) ) : ?>
And it is successfully sorting by user name.What am I missing that it isn’t working?
and this will use the Last Name field to alphabetize?
I have never created a child theme for anything before, so this is a learning experience for me!
THank you!