WordPress maintenance or security needs? Reach out!
TLDWP

Plugin: post-avatar (Used by 34 domains)

Post Avatar

Allow authors to select an image from a pre-defined list while in the Post Editor screen. This image will be displayed together with a post.

Post Avatar is similar in concept to Livejournal userpics wherein authors choose images uploaded by the site owner. Developed with Dominik Menke.

Features

  • Easy selection of images from within the Post Editor screen.
  • Scans images in sub-directories of the image option folder.
  • Allows the following file types: .jpg, .jpeg, .gif and .png.
  • Flexible with customizing avatar display.
    • Display avatars using the default HTML/CSS tags.
    • HTML/CSS tags can be edited from with the Settings screen.
    • Use template tags and custom filters within themes for advanced customization.
  • International language support for Belorussian, Czech, Dutch, French, German, Hindi, Irish, Italian, Polish, Romanian, Serbo-Croatian, Spanish
  • Does not display missing images.
  • Can be further extended to show images for pages and custom post types

Bug Submission and Forum Support

WordPress Forum

Post Avatar home page

Please Vote and Review

Your votes and feedback are greatly appreciated. Thanks.

Advanced Customization

For Front End Display

By default, the plugin hooks into the following filters: the_content() and the_excerpt().

OVERRIDE HTML DISPLAY USING FILTER HOOK: gklpa_the_postavatar

The gklpa_the_postavatar filter takes two parameters:

  1. $post_avatar_text – Original HTML display

  2. $post_avatar – Post Avatar data in array format. The keys are:

    avatar_url: The URL to the image        
    show_image_dim: 1 indicates to show image dimensions, 0 to hide them                
    image_height: integer value of image height or null if image dimensions is turned off               
    image_width: integer value of image width or null if image dimensions is turned off             
    post_id: ID of current post             
    post_title: Post title for the image attribute              
    image_name: Image file name
    

Example: Display a default image if no avatar is selected

This example makes use of the HTML/CSS settings defined by the site admin.

    add_filter( 'gklpa_the_postavatar', 'prefix_show_default_image', 10, 2 );
    function prefix_show_default_image( $post_avatar_html, $post_avatar_array ){
        global $post, $gklpa_plugin_settings;

        // Display default image;
        if( is_null( $post_avatar_array ) ){
            if( !empty( $gklpa_plugin_settings['css_class'] ) {
                $css = 'class="' . $gkl_plugin_settings['css_class']. '"';
            }
            $post_avatar_html = $gklpa_plugin_settings['html_before' ] . '' . esc_attr(strip_tags($post->post_title) ) . ''. $gklpa_plugin_settings['html_after'];
        }
        return $post_avatar_html;
    }

OVERRIDE HTML DISPLAY WITH CUSTOM CONTENT HOOK

If you want to change the HTML completely or override the option to display avatars automatically, use the remove_filter() like so:
remove_filter(‘the_content’, ‘gkl_postavatar_filter’, 99 );
remove_filter(‘the_excerpt’, ‘gkl_postavatar_filter’, 99 );

You can then define your own the_content filter function that makes use of the gkl_postavatar() or gkl_get_postavatar() functions

You will need to use the function gkl_get_postavatar() which takes the post object and returns the array of post avatar information.

  1. $post_avatar_array – Post Avatar data in array format. The keys are:

    avatar_url: The URL to the image
    
    show_image_dim: 1 indicates to show image dimensions, 0 to hide them
    
    image_height: integer value of image height or null if image dimensions is turned off
    
    image_width: integer value of image width or null if image dimensions is turned off
    
    post_id: ID of current post
    
    post_title: Post title for the image attribute
    
    image_name: Image file name
    

Example:

    add_filter( 'the_content', 'my_custom_post_avatar' );
    function my_custom_post_avatar( $content ){
        global $post;

        $current_avatar = gkl_get_postavatar( $post );
        $html_before = '';
        $html_after = '';
        // Display default image
        if( is_null( $current_avatar ) ) {
            $image_url = 'http://wplatest.dev/images/default-image.jpg';
            $alt_text = esc_attr(strip_tags($post->post_title) );
        } else {
            $image_url = $current_avatar['avatar_url'];
            $alt_text = $current_avatar['post_title'];
        }
        $post_avatar_html = $html_before . '' . $alt_text . ''. $html_after;

        return $post_avatar_html;   
    }

OVERRIDE HTML DISPLAY WITH template tag gkl_postavatar

If you want the post avatar to appear outside of the content, e.g. with the entry’s meta information, make use of the gkl_postavatar() template tag.

It takes four paramters:

    class: CSS class to use in the `` tag. 
    before: HTML to appear before the image.    
    after: HTML to appear after the image.  
    do_what: Use `echo` to display the post avatar, `return` to pass it to a variable. Defaults to `echo`.

Example: In a template file:

    

Or you can make your own template tag function like in the example for “Override HTML display with custom content hook”, except you call the function directly in your template instead of hooking into the_content().

For Administration Screens

Add Post Avatar to Pages and Custom Post Types

Use the filter hook gklpa_allowed_post_types to add further post types that you want the Post Avatar selection to appear on.

It takes an array of post type slugs as a parameter.

    add_filter( 'gklpa_allowed_post_types', 'prefix_my_custom_post_types' );
    function prefix_my_custom_post_types( $current_post_types ){
        $current_post_types = array( 'post', 'page', 'review', 'event' );
        return $current_post_types;
    }

Enable Image Selection for Folder Outside of WordPress Installation

By default, Post Avatar looks for your images folder in relation to your WordPress installation. If you want to move your folder elsewhere, use these pair of filter hooks: gklpa_image_url and gklpa_image_dir. They take a single parameter: Image folder url and absolute path to the image folder, respectively.

    add_filter( 'gklpa_image_url', 'prefix_change_folder_url' );
    function prefix_change_folder_url( $current_url ){
        return esc_url( 'http://mysite.com/images/' );
    }

    add_filter( 'gklpa_image_dir', 'prefix_change_folder_dir' );
    function prefix_change_folder_dir ){
        return '/user/public_html/images/';
    }

Please visit the Post Avatar Page for details on customizing the avatar display.

Translations

Post Avatar is translation-ready and supports a number of languages. If you can’t find your language here, please consider contributing a language pack.

If you’re interested, please check out the “Codestyling Localization” plugin and for validating the “Poedit Editor”.

Send in your translations to [email protected]

Thanks to the following for their language packs.

  • Belorussian (ru_RU) Fat Cower
  • Czech (cz_CZ) Lelkoun
  • Dutch (nl_NL) Jay August
  • French (fr_FR) Mathieu Haratyk
  • German (de_DE) Dominik Menke
  • Hindi (hi_IN_Hindi) Outshine Solutions
  • Irish (ga_IR) Ray S.
  • Italian (it_IT) Gianni Diurno
  • Polish (pl_PL) Meloniq
  • Romanian (ro_RO) Webhosting Geeks
  • Serbo-Croatian (sr_RS) Webhosting Hub
  • Spanish (es_ES) gogollack
DomainExposuresHeadersLast Checked
t*o*s*h*o*k.com (WP 6.8.8) F Aug 24, 2026
u*p*u*t*o.com (WP 4.7.29) F Aug 21, 2026
a*o*f*i*e*.com (WP 7.0.4) F Aug 20, 2026
i*m*g*a*i*n*b*i*-*o*d*.com (WP 7.0.4) F Aug 17, 2026
w*r*e*s*k*e*.com (WP 7.0.4) F Aug 16, 2026
p*r*n*r*e*h*.com (WP 7.0.4) F Aug 14, 2026
f*u*t*g*r*n*.com F Aug 14, 2026
s*a*t*r*d*t*a*q*i*i*y.net F Aug 6, 2026
t*m*-*c*r*i*e*.de (WP 6.2.9) F Aug 5, 2026
a*e*o*h*c*.com F Aug 1, 2026
a*s*i*a*d*m*a.com F Jul 30, 2026
c*r*o*d*l*r*s*.com F Jul 29, 2026
m*m*c*l*i*.com (WP 3.3.1) F Jul 27, 2026
t*e*l*e*r*n*s*o*l*v*n*.com (WP 7.0.2) D Jul 27, 2026
s*r*k*-*w*.com (WP 7.0.2) F Jul 26, 2026
t*a*h*b*i*l*d*.com F Jul 25, 2026
t*f*l*e*n*s*a*k*.nl F Jul 24, 2026
r*p*-*e*u*.c*.uk F Jul 23, 2026
f*l*z*f*a*d*o*i*.com (WP 6.8.3) F Jul 23, 2026
f*n*i*g*s*f*a.com (WP 4.9.26) F Jul 22, 2026
e*p*c*j*u*e*s*.fr (WP 5.1.21) F Jul 21, 2026
p*w*r*a*s*f*w*r*.com (WP 7.0.2) F Jul 20, 2026
p*w*r*a*g*m*s.com (WP 7.0.2) F Jul 20, 2026
i*m*c*e*y.com F Jul 20, 2026
a*k*r*.ru (WP 4.9.26) F Jul 16, 2026
2*1*g*d.ru F Jul 14, 2026
a*i*o*d*a*a*e*i*a.com F Jul 14, 2026
k*n*a*a*e*i*i.com F Jul 12, 2026
j*u*n*y*i*h*e*s*n.com (WP 6.9.4) F Jul 12, 2026
p*w*r*a*.net (WP 7.0) F Jul 10, 2026
s*e*s*e*d.com F Jul 8, 2026
s*e*n*h*r*i*a*.com F Jul 8, 2026
m*g*s*e*s*t*r*a*e.com (WP 7.0) F Jul 7, 2026
g*m*s*e*s*n.com (WP 7.0) F Jul 7, 2026

Top 50 Plugins

Plugin Count
elementor 1,752,269
contact-form-7 1,734,913
elementor-pro 1,042,969
woocommerce 809,301
revslider 600,598
jetpack 449,628
js_composer 413,971
wp-rocket 336,041
essential-addons-for-elementor-lite 261,383
gravityforms 254,924
complianz-gdpr 253,919
google-site-kit 234,164
cookie-law-info 225,784
instagram-feed 221,890
sitepress-multilingual-cms 208,071
header-footer-elementor 203,584
google-analytics-for-wordpress 202,140
bluehost-wordpress-plugin 191,353
elementskit-lite 177,076
gutenberg 168,426
cookie-notice 146,605
litespeed-cache 145,566
gutenberg-core 126,202
gtranslate 122,354
the-events-calendar 121,357
wpforms-lite 121,140
astra-sites 110,947
popup-maker 108,105
woocommerce-payments 107,897
tablepress 101,709
honeypot 97,446
astra-addon 92,629
coblocks 92,193
duracelltomi-google-tag-manager 89,623
wp-smushit 89,524
layerslider 87,724
all-in-one-seo-pack 87,488
bb-plugin 85,659
akismet 83,989
premium-addons-for-elementor 82,644
ml-slider 82,288
cleantalk-spam-protect 81,255
mailchimp-for-wp 80,293
megamenu 79,514
jet-engine 77,267
ewww-image-optimizer 76,708
wp-pagenavi 76,276
fusion-builder 76,156
woocommerce-gateway-stripe 75,270
smart-slider-3 75,073

Top 50 Themes

Theme Count
hello-elementor 615,636
Divi 489,356
astra 408,710
flatsome 143,174
Avada 119,640
generatepress 113,787
pub 87,837
oceanwp 79,196
kadence 78,004
enfold 67,704
salient 64,296
twentyseventeen 53,768
twentytwentyfour 52,603
bb-theme 52,472
betheme 52,125
blocksy 50,378
cocoon-master 49,045
twentytwentyfive 45,433
dt-the7 44,982
woodmart 44,663
h4 43,939
neve 37,567
Avada-Child-Theme 36,657
gox 36,181
bridge 30,725
lightning 30,035
twentytwentyone 29,878
twentytwenty 28,365
swell 28,169
bricks 26,622
Impreza 25,820
Newspaper 23,905
twentytwentythree 21,758
epik-redesign 18,971
twentytwentytwo 18,529
uncode 18,234
twentysixteen 17,516
pro 17,439
storefront 16,051
sydney 15,979
Total 14,211
hello-theme-child-master 13,884
factory-templates-4 13,807
themify-ultra 12,852
hestia 12,436
yootheme 12,375
yith-wonder 11,928
extendable 11,903
porto 11,785
jupiter 11,725