Get achievement post thumbnail with earned/unearned-distinction
-
I’m trying to get thumbnails of certain badges in a content-template. This works with the following code (the essential function is badgeos_get_achievement_post_thumbnail):
$posts = get_field('badges'); if( $posts ): ?> <?php foreach( $posts as $post): // variable must be called $post (IMPORTANT) ?> <?php setup_postdata($post); ?> <?php echo badgeos_get_achievement_post_thumbnail( $post->ID ); ?> <?php wp_reset_postdata(); // IMPORTANT - reset the $post object so the rest of the page works correctly ?> <?php endforeach; ?> <?php endif; ?>
However, what I wanted is to show earned badges like they are displayed now (coloured), but to show unearned badges greyed out. How can I achieve this?
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Get achievement post thumbnail with earned/unearned-distinction’ is closed to new replies.