Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Image in search results › Reply To: Image in search results
April 25, 2019 at 5:41 pm
#22322
Participant
Thank you very much, Ernest, but it doesn’t work to me, I don’t know why!
I’ve got something like this in my users directory page to get the images:
foreach($theusers as $auser)
{
$auser = get_userdata($auser->ID); //At the top of the directory.php
$auser->membership_level = pmpro_getMembershipLevelForUser($auser->ID);
…..
if (get_user_meta($auser->ID, ‘foto’, true)) {
if (in_array( ‘pmpro_role_2’, (array) $auser->roles))
{
echo '<a target="_blank" class="'.$avatar_align.'" href="'. add_query_arg('pu', $auser->user_nicename, $profile_url).'">'. (wp_get_attachment_image( $attachment_id, 'thumb')).'</a>';
}
P.S. I’m displaying the results in the Page results search (Redirect to: Results page)
Thank you,