Not showing badge image
-
Any idea why my badges are not showing images?
I’m using the snippet:// Make sure our website does not crash if myCRED is disabled. if ( function_exists( 'mycred_get_users_badges' ) ) : // Only needed if you do not have the author object. We want an ID $author = get_user_by( 'slug', get_query_var( 'author_name' ) ); $author_id = $author->ID; // Get the authors earned badges $authors_badges = mycred_get_users_badges( $author_id ); // If the author has badges, loop though them and show each image. if ( ! empty( $authors_badges ) ) { foreach ( $authors_badges as $badge_id ) echo '<img src="' . get_post_meta( $badge_id, 'main_image', true ) . '"' . $width . $height . ' class="mycred-badge earned" alt="' . get_the_title( $badge_id ) . '" title="' . get_the_title( $badge_id ) . '" />'; } endif;And the HTML in response is:
<img src="" class="mycred-badge earned" alt="" title="">…even after clear caches.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Not showing badge image’ is closed to new replies.