WordPress.org

Forums

Simple Local Avatars
Call Simple Local Avatar (1 post)

  1. prodigiworld
    Member
    Posted 1 year ago #

    Hi,

    I think that Im very close to achieve my goal..
    I have this function on my themes but I need your help to find the right way to cal your function so it will show the local author simple local avatar?

    $first_img = get_avatar( $post->post_author );

    Can you help?

    function get_post_image() {
      global $post, $posts;
      $first_img = '';
      ob_start();
      ob_end_clean();
      $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
      $first_img = $matches [1] [0];
    
      if(empty($first_img)){ //Defines a default image
        $first_img = get_avatar( $post->post_author );
      }
      return $first_img;
    }

    http://wordpress.org/extend/plugins/simple-local-avatars/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic