Post Avatar

Post Avatar

Wordpress plugin

Install on Wordpress

App Details

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' ] . '<img '. $css . ' src="http://wplatest.dev/images/default-image.jpg" alt="' . 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 = '<span class="alignleft">'; $html_after = '</span>'; // 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 . '<img src="'. $image_url . '" alt="' . $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 `<img>` 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:

 <div class="entry-meta"> <?php gkl_postavatar('', "<span class='alignleft'>", "<span>" );?> -- more template tags here -- </div> 

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

Pricing

Starting from $0 per month.

Check Out the Image Gallery Widget

By Common Ninja

Image GalleryTry For Free!

App Info

Rating

Reviewers

1 reviews

Tags

avatars
image
images
post
thumbnail

Developed By

Vicky Arulsingam

Quick & Easy

Find the Best Wordpress plugins for you

Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!

Testimonial

Testimonial plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Forms

Forms plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Comments

Comments plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Maps

Maps plugins for Wordpress

Security

Security plugins for Wordpress

Translation

Translation plugins for Wordpress

Ads

Ads plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Chat

Chat plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Membership

Membership plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Contact

Contact plugins for Wordpress

Comments

Comments plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

Image Gallery for Wordpress logo

Image Gallery

Showcase photos with an image gallery that displays pictures and captions in grids, improves design, and boosts visitor engagement.

Course Listings for Wordpress logo

Course Listings

Create course listings with a course catalog widget that displays programs clearly, supports easy organization, and helps visitors explore courses effectively.

Logo Slider for Wordpress logo

Logo Slider

Add a logo slider to your site to showcase clients and partners, strengthen brand credibility, and build trust with new visitors.

Quotes Carousel for Wordpress logo

Quotes Carousel

Show inspiring quotes with a quotes carousel that rotates messages, enhances design, and keeps visitors engaged.

Telegram Conversation for Wordpress logo

Telegram Conversation

Show Telegram conversations on your website in a clear, authentic chat format.

Medium Feed for Wordpress logo

Medium Feed

Show Medium articles in a Medium feed that keeps content fresh, improves readability, and helps visitors discover more posts.

Charts & Graphs for Wordpress logo

Charts & Graphs

Add charts and graphs to your site to present data clearly, help visitors understand insights faster, and support more confident decision making.

Corner Pop-up Builder for Wordpress logo

Corner Pop-up Builder

Add floating corner pop-ups to share updates, promotions, or messages in a non-intrusive, customizable format.

Messenger Chat for Wordpress logo

Messenger Chat

Add Messenger Chat to your site to communicate with visitors, offer fast support, and create a smoother user experience across all pages.

Consent Form for Wordpress logo

Consent Form

Create consent forms that collect signatures, save submissions, send notifications, and help you manage approvals efficiently.

Website Search for Wordpress logo

Website Search

Add a Google powered search bar that delivers relevant results, improves navigation, and helps visitors find content fast.

Bluesky Feed Slider for Wordpress logo

Bluesky Feed Slider

Show Bluesky posts with a Bluesky feed slider that scrolls updates and keeps content visible while keeping visitors engaged.

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!

Multiple platforms