You’ll have to substitute $bp->displayed_user->id
with bp_get_member_user_id()
to make it work within the members loop.
I’m guessing that that function is used in other parts of your theme as well and changing the $user_id
variable will probably screw things up, so it might be better to copy that function across to your themes functions.php file. You’ll have to rename the function to avoid any conflicts, change the user id and then use your new function in the members loop.
Related Posts:
- How to edit bbPress template files – WordPress + BuddyPress + bbPress? [closed]
- How to override BuddyPress 3.0 bp-nouveau theme files?
- How to display posts in hyperlink with nested slugs?
- buddypress: how do i make the group description excerpt shorter?
- wp_update_comment not working
- Subsite theme mystery man replacement with Buddypress on main site [closed]
- Not Found when using activity stream as front page with BuddyPress
- How do I add settings to the Background Options Page?
- Import media to online WordPress from local development
- How to add a checkbox element to attachments editor with example
- Auto get_header and get_footer on every template?
- What is the right way to include a wp-admin file in your theme?
- Theme Check gives: Required: This theme doesn’t seem to display tags?
- Is it possible to use line break in theme description?
- How does WordPress decide what template to use as frontpage
- Override Current Theme Setting in wp_config.php
- Theme showing incorrect update
- modify a output of a widget
- How do I “unhook” / de-register jQuery so that it’s not called as part of wp_footer();?
- changing Specific section background image in wordpress
- WP Gutenberg custom block – generate theme colors from SASS and use them in the inspector and php callback
- Which is the simplest theme for WordPress to use it as your base?
- How to highlight the current page in the nav menu?
- Is tag default in WordPress?
- “Display Site Title and Tagline” checkbox not working?
- Should I use language_attributes() or bloginfo(“language”) in html tag
- Getting jquery to work with custom theme
- How to retrieve an image from a post and display it before excerpt of a post? [duplicate]
- Why does WP recommend against custom favicon functionality in themes?
- What’s the best action to use when you want to do something only once per theme setup?
- Excluding a page with a certain name from wp_page_menu
- Widgets with groups / sub widgets? Widget in a widget?
- Avada resources still loading from localhost after database migration [closed]
- No Appearance –> Header menu
- How do I create a custom partial / template?
- Internationalization and functions that use it
- Get a setting value conditionally in the Customizer api
- How should I be handling my theme version numbering?
- How would you accomplish the following advanced settings page?
- image url relative path not working in css file
- Update Custom Theme Version
- Storefront child theme not applying parent theme [closed]
- Sort wp_query by sum of two meta fields
- What can I use for small text when converting to WordPress?
- How to specify the “Main Sidebar” for a theme
- How to i style the elements from the TinyMCE
- Integrate WooCommerce theme with a WordPress theme [closed]
- Automated Footer information
- How do you use WordPress for a website that’s not in a blog format?
- Custom theme, contact form 7 & fast secure form doesn’t work
- How to develop a menu like wwe.com?
- Add tags to pages
- Why set a second parameter in the translate function?
- How to escape multiple attribute at once in WordPress?
- Override plugin option by with a custom theme
- Replace site title with logo when logo is uploaded in customizer using
- Making a WordPress theme based on twentyten
- Doing context-aware previews in the WordPress Customizer
- multiple html/css files for wordpress theme?
- Create new wordpress theme with no need update
- Multi Site Setup, Child Themes, Getting Style Sheet Directory
- Add image URL automatically to custom field?
- content filter (add_filter) for category description?
- How do I pass the category object to a function when is_archive() is true?
- Making a horizontal flyout menu from WordPress category listing
- How to use Canonical URL meta tag to avoid duplicate content issues with WP home pages
- getBoundingClientRect() showing different values on load vs scroll
- How to update mark-up of a gallery block in a custom theme?
- Host Private Custom Theme
- How do I make my terms for each product display via foreach loop? (woocommerce)
- WordPress Insert ads after every 5th post
- Exclude categories from wp query not working
- Copying a modified theme from one wordpress site to another wordpress site [closed]
- How to get custom logo with REST API instead of get_theme_mod();
- How can I change this SVG shape that’s generated?
- Can I set rest API endpoints from within a theme?
- Theme starter content translation is not working
- (Parent) theme Is Not Showing In Theme Selection Panel and Therefore Breaks Child Theme
- How to add an image to a theme page template in code?
- remove_action(‘genesis_header’,’genesis_do_header’) hook not working
- Text View (Code View) in WordPress Customizer TinyMCE Editor
- Customizer Image-Picker Preview Not Working
- Breaking Categories Up into Individual Divs
- Different stylesheet for different pages not working fully
- Strip HTML tags on custom code from the_content
- wpdb->insert adds too many rows
- wpalchemy repeating fields dropdown issue
- Does WordPress require that your submitted theme supports multiple menu levels?
- WordPress loop not working on blog.php page
- Option to show/hide widget depending on is_home?
- Add Dynamic Sidebar to Exisiting WordPress Theme [closed]
- Why does the first loop take arguments from the second loop?
- How do I middle-align my header menu items in WordPress [closed]
- Theme layout for home page [closed]
- How to add Dummy content when active wordpress theme without xml import?
- Is there any reason that other theme elements (such as nav menus) shouldn’t be within the loop?
- Is there any way to show child theme in theme detectors?
- Creating image grid on products page in wordpress
- Insert gutenberg blocks into template
- What is the point of using archive.php instead of index.php?