Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- blog content -->
- <div class="blog-content">
- <div class="blog-pad blog-content-title">
- <h2>Rank: <?php the_title(); ?></h2>
- </div>
- <div class="blog-pad blog-content-excerpt">
- <?php
- $post_id = get_the_ID();
- $min = get_post_meta( $post_id, 'mycred_rank_min', true );
- $max = get_post_meta( $post_id, 'mycred_rank_max', true );
- ?>
- <p>This rank requires a minimum token earnings of <?php echo $mycred->format_creds( $min ); ?>.</p>
- <?php if ( is_user_logged_in() ) : ?>
- <h5>Your rank progress</h5>
- <?php
- $progress = number_format( ( ( $users_balance / $max ) * 100 ), 1 );
- $options = 'options="striped,animated"';
- if ( $users_balance > $min && $users_balance > $max ) {
- $progress = number_format( 100, 1 );
- $options = '';
- }
- elseif ( $users_balance < $min ) {
- $progress = number_format( 0, 1 );
- $options = '';
- }
- echo do_shortcode( '[vc_row][vc_column width="1/1"][vc_progress_bar values="' . $progress . '|' . get_the_title() . '" bgcolor="custom" ' . $options . ' custombgcolor="#E74C3C" title="" units="%"]<div class="mycred-progress-desc"><div class="rank-minimum">' . $mycred->format_creds( $min ) . '</div><div class="rank-maximum">' . $mycred->format_creds( $max ) . '</div></div>[/vc_column][/vc_row]' );
- endif;
- ?>
- </div>
- <div class="blog-pad blog-content-meta">
- <footer class="entry-meta"> </footer>
- </div>
- </div>
- <!-- blog content end -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement