get_current_user_id(); gets the current logged in user id and you need the user whos profileUrl is views so try this insted to get the right id:
$author = get_user_by( 'slug', get_query_var( 'author_name' ) );
echo $author->ID;'
yep, so instead of your code try this:
$author = get_user_by( 'slug', get_query_var( 'author_name' ) );
if ($author->ID > 0) {
rhb_list_badges(array('user_ID' => $author->ID));
}
Related Posts:
- Bug in Stackoverflow styled badge system script
- Set a User as Author of all ‘New Posts’ posted
- Change destination author link
- wordpress plugin that show my reputation (points) in any stackexchange project in my wordpress blogs
- Get total number of comment of the posts written by an author
- Change get_current_user_id code to the author’s profile
- Display Author name PHP (Selfmade Plug-IN)
- How to get the total count of Favorite/Favorited authors
- Displaying friend’s posts only
- Publish author posts only with editor approval?
- Customizing subject in comment notification e-mails
- Plugin or mod for wordpress to make content publication SUPER easy
- Suggest a plugin for up/down voting posts [closed]
- Cropping, Re-sizing and Saving images from one folder to another folder in wordpress
- How to develop a community feature in the dashboard for multiauthor site
- Creating search filter through plugin
- Displaying Gravity Form data on WordPress page [closed]
- Missing argument 3 for wp_register_sidebar_widget()
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- How can I get WordPress to save comments in markdown format?
- Shortcode button dosent work for all posts. Work for first post only
- Is Wrapping intval() Around esc_attr() Redundant for Escaping Input?
- Display data on Word Press site posts and pages from mysql table
- How make a php script run only with wp-cron
- Redirection of users away from wp-admin (but not administrators)
- Most efficient way to use classes to create admin pages using Settings API
- CMB2 toolkit: Compare 2 Dates and validate the Time
- PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback Error without any function name
- 306 MB of wp_options occupied by WordPress SEO Plugin, is that normal? [closed]
- Adapt PHP form action for WordPress?
- Perform internal redirect in WordPress?
- How to prevent plugins from loading jQuery
- Using TinyMCE in plugin?
- Use wordpress plugin in codeigniter
- Show author on every sub-page
- Notice: Uninitialized string offset: 0 in social sharing mu-plugin
- How to Loop Through all Posts and Count Attachments using Get Media Attachments
- Only allowing some emails to create an account [closed]
- Get ‘Headers already sent’ error for the plugin I am creating when I try to login
- How to redirect to same page after form submission
- Return multiple values in a shortcode attribute
- get specific value of a array | PHP
- How to add a new column with text fields to WooCommerce Cart List?
- Woocommerce: limit user to see only the products he created
- OceanWP settings are missing from Add New Post [closed]
- Creating a functionality plugin to edit seriously simple podcasting
- Programatically upload a file to be stored inside blob field in database, NOT on filesystem
- Asynchronous request in wordpress
- Make plugin php file called directly aware of WordPress?
- Creating an admin meta box to save post as pending
- Custom meta box with jQuery.sortable custom post type list
- Passing value as hidden parameter to next page
- Next Previous Post in wordpress with previous / next link with title?
- Apply html elements in php statement
- WordPress Post HTML after Posting
- Settings options not showing up on Sub Menu page in WordPress plugin
- Cannot Access Console
- Plugin error after installation
- Get product categories and add them to a custom taxonomy
- woocommerce remove coupon link does not work
- add_rewrite_rule to load different page, without changing URL in browser
- Plugin or ways to limit number of users logging in the website,
- Replace old theme that understand old css (vcex_icon_box css_animation)
- How to insert datas in the table on wordpress?
- WP Ajax DB issues
- ACF checkbox return format based on page
- How to get database connection details without longing to cpanel in WordPress?
- The Build menu theme is frozen with the wordpress theme
- Does anyone know why my SEO and title become one?
- Adding discount functionality to the cart
- Precheck fields when I add a new post
- How to translate wordpress blog to other languages?
- How to translate to spanish wordpress hardcoded content/files?
- How to get a post views count using ‘WordPress popular posts’ plugin
- Multiple image selection custom widget
- strtotime not working
- Change custom rewrite rule when permalink is updated/changed
- Remove dashboard links from wordpress
- Optimized PHP & WordPress settings for speed/performance?
- Any method to make specific widget for every post and page?
- How to add php plugin code in theme
- Populate select option with JSON file
- Embed Javascript code to registered users only
- Find all strings between an enclosing shortcode
- How to speed up installing plugins and upgrading WordPress
- How to set up php,javascript and css to allow for our finished product to be displayed within a page?
- Hyperlink to execute PHP
- How to get site homepage from plugin?
- update_post_meta not working
- Pulling Advanced Custom Fields from other pages
- Vote It Up Plugin – Add ascending numbers to MostVotedAllTime Chart Function
- How to fix vanilla comments extra iframe space
- Unable to show 4 products in a row
- Meta Box plugin image_advanced not showing up on frontend
- Creating Features List in WordPress Post
- PHP Creating a formula from mysql db values and db stored math operator
- wp_handle_upload – specified file failed upload test
- Warning: Undefined variable $admin
- Split Million WordPress Post’s Into Multiple Database Server
- public custom posts not showing in my wordpress plugin