I am trying to display random users to follow for the user pro plugin. I am displaying the shortcode but not actually doing the shortcode.
<?php $input = Array('[userpro template=list list_per_page=1 list_showbio=1 list_showsocial=0 no_style=true list_users="randomuser1"]','[userpro template=list list_per_page=1 list_showbio=1 list_showsocial=0 no_style=true list_users="randomuser2"]'); ?>
<?php echo $input[array_rand($input)]; ?>
[userpro template=list list_per_page=1 list_showbio=1 list_showsocial=0 no_style=true list_users="randomuser1"] is displaying in the template which is exactly what I need but this does not work unless it is in a widget. I can not use php echo shortcode with this shortcode for whatever reason (probably a plugin issue). The code below shows nothing for me. So how can I get the shortcode that $Input is echoing to be in a widget area?
<?php echo do_shortcode('[userpro template=list list_per_page=1 list_showbio=1 list_showsocial=0 no_style=true list_users="randomuser2"]'); ?>
Aucun commentaire:
Enregistrer un commentaire