This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Image in search results

#22322
sabbellasabbella
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,

  • This reply was modified 7 years, 1 month ago by sabbellasabbella.
  • This reply was modified 7 years, 1 month ago by sabbellasabbella.