Since I wanted Livejournal functionality on my blog, I went in search of some plugins that could help me display an image with a post.
I tried the Post Image plugin but that meant I had to upload a picture for every time I made a new post. I found that wasteful since I tend to re-use images in my posts.
Next I tried just placing in the link to the image in the Custom Fields section of the Write Post screen but I have difficulty remembering the image names and I spent too much time checking on the different pictures.
So I decided to create a plugin that would display a list of images I had already uploaded, for me to select when adding a post.
* Easy selection of images in the Write Post screen.
* Allows the following file types: .jpg, .jpeg, .gif and .png.
* Template tag to display in themes.
* Does not display missing images.
- Download Post Avatar. Unzip the contents and upload gkl-postavatar.php to the WordPress plugin folder (/wp-content/plugins).
- Activate the plugin from the Plugin Management screen.
- Go to Options » Post Avatar ». Set the following options:
* Path to Images Folder – location of your images folder in relation to your WordPress installation.
* Show image in Write Post Page – Set to “Y” if you want to see a thumbnail of the post avatar in the Write Post screen. If not set to N.
A. Upload images
Upload the images that you intend to use to the folder defined in the Post Avatar options.
B. Display post avatars in your theme
Add the following within The Loop;
<?php if (function_exists('gkl_postavatar')) gkl_postavatar() ; ?>
The plugin will show your image encased within a <div> with the CSS class, “postavatar”. You may want to add a style for this in your stylesheet.
<div class="postavatar"><img src="http://www.garinungkadol.com/wp-content/images/icons/messer01.jpg" alt="post title" height="100" width="100" border="0" /></div>
C. Adding Post Avatars
- To add an image to a post, go to the Post Avatar section (just below the Save button).
- Select the image name from the list.
- Save your entry.
- Initial release
Please use the comments section to submit bugs, get help or leave feedback.