I am trying to add ordinal suffixes to a WordPress Post Counter that I am building for a ranking board. Here is the code I currently have.
<?php if(have_posts()): $counter = 1; query_posts('post_type=rushmoor&meta_key=subaru_driver_best_lap&orderby=meta_value_num&order=asc'); while(have_posts()):the_post();?>
<?php $driver_best_lap = get_post_meta( get_the_ID(), 'subaru_driver_best_lap', true );?>
<li>
<div class="name"><?php echo $counter;?> <?php the_title();?></div>
<div class="lap-time"><?php echo $driver_best_lap;?></div>
</li>
<?php $counter++; endwhile; wp_reset_query(); endif;?>
I have been trying to merge code from the following link with the above, however I cannot yield anything that actually works and am wondering if anyone can assist.
add 'rd or 'th or 'st dependant on number
Thanks Zach