OK you will need to a bit of coding for this
The only why I can thing of doing what you need is:
call the author avatar shortcode via do_shortcode() and cache the output in a transuent set to expire in 24 hours
$my_ramdom_avater = get_tranistent(C;
if( false == $my_ramdom_avater ){
$my_ramdom_avater = do_shortcode(‘[author_avatar …]’);
set_tranistent(‘my_ramdom_avater’, $my_ramdom_avater );
}
echo $my_ramdom_avater;
put this in the theme where need it to display
this hasn’t test at all
Thread Starter
af3
(@af3)
Thanks Paul. Checking it out now..
Thread Starter
af3
(@af3)
the idea works. thanks again!
I forgot to set the cache expiry time in the
set_tranistent(‘my_ramdom_avater’, $my_ramdom_avater, DAY_IN_SECONDS );
I added the required option to it here
http://codex.wordpress.org/Easier_Expression_of_Time_Constants
Thread Starter
af3
(@af3)
Thanks. I used this to generate 3 random users to win free lunch of the week:
$random_id = '';
if ( false === ( $random_id = get_transient( 'free_lunch_avatars' ) ) ) {
$random_id = do_shortcode('[authoravatars hiddenusers=admin limit=3 order=random avatar_size=120 show_name=true]');
set_transient('free_lunch_avatars', $random_id, 60*60*24*7); # save the ID returned, transient 7 day
}
echo $random_id;