Title: Post Icon plugin??
Last modified: August 18, 2016

---

# Post Icon plugin??

 *  [roraz](https://wordpress.org/support/users/roraz/)
 * (@roraz)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/post-icon-plugin/)
 * This might be wishful thinking on my part, but after hours of searching through
   this sites support threads (only getting catergory icon threads) and google I
   thought Id give it a shot and ask:
 * Basically what Im looking for is a plugin that (in my dreams) would have in the
   post writing area, an upload section where you could upload a thumbnail to represent
   that particular post, which would be uploaded to a set folder (such as ‘posticons’)
   and if need be renamed to the post id number eg ’56.jpg’ for easy reference.
 * Then in the post template there would be a tag for that posts icon such as <?
   php the_content(); ?> but like <?php the_post_icon(); ?> so on the sites main
   page the thumbnails would be next to each corresposnding post, or anywhere else
   where you would like to represent a particular post such as in the sidebar etc
 * and if there was no uploaded thumbnail for a post it would default to that posts
   catergory icon in folder ‘catergoryicons’
 * basically Im looking for a plugin that can do the same as the post icons as these
   sites, with decent post icon management:
    [http://www.site73.com/](http://www.site73.com/)
   [http://www.xposed.com/](http://www.xposed.com/)
 * like I said its wishful thinking but I thought It would be a cool thing to have
   on my site, so I had to check if anybody knew of something that could do this
   or similar?!

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/post-icon-plugin/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/post-icon-plugin/page/2/?output_format=md)

 *  Thread Starter [roraz](https://wordpress.org/support/users/roraz/)
 * (@roraz)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/post-icon-plugin/#post-255229)
 * nobody?? Thought not…
 * anybody know anybody thats good at making plugins for wp?
 *  [yas](https://wordpress.org/support/users/yas/)
 * (@yas)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/post-icon-plugin/#post-255241)
 * We have something like that over at [http://no.oneslistening.com](http://no.oneslistening.com)
   It lacks the upload feature at the moment, but that would be easy enough to add.
   Ours just uses metadata, so any filename will do. You just call the image using
   a custom function that only shows the image if it actually exists, so no broken
   pics. Check it out here: [http://no.oneslistening.com/?p=151](http://no.oneslistening.com/?p=151)
   and [http://no.oneslistening.com/?p=125](http://no.oneslistening.com/?p=125)
   
   I’d be happy to post the source (and a better description) and let people have
   at it.
 *  [Fr3d](https://wordpress.org/support/users/fr3d/)
 * (@fr3d)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/post-icon-plugin/#post-255247)
 * Try “Exhibit” here: [http://redalt.com/downloads/](http://redalt.com/downloads/)
 * Scroll to the bottom and 4th/5th up (depending on how you count)
 * WP1.5 File: [http://redalt.com/downloads/wp/asy_exhibit.zip](http://redalt.com/downloads/wp/asy_exhibit.zip)
   
   WP other File: [http://redalt.com/downloads/wp/exhibit11d.zip](http://redalt.com/downloads/wp/exhibit11d.zip)
 * Hope this helps 😀
 *  Thread Starter [roraz](https://wordpress.org/support/users/roraz/)
 * (@roraz)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/post-icon-plugin/#post-255249)
 * Thanks Fr3d, Id actually found Exhibit myself but found that it is more for attaching
   images to posts, kinda as footnote images to the post that are made…
 * Yas, the one you have on your site looks great, im reading those links you gave
   me, if you got anything more to give about Ill definately take a look
 * I think other people would be really interested in smething like this as well
   😉
 *  [yas](https://wordpress.org/support/users/yas/)
 * (@yas)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/post-icon-plugin/#post-255251)
 * Sure thing. I’m always willing to share the source. I’ll revisit the issue and
   post the source along with some more information about how it works after the
   work day is over.
 *  Thread Starter [roraz](https://wordpress.org/support/users/roraz/)
 * (@roraz)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/post-icon-plugin/#post-255275)
 * cheers I would appreciate that….
 *  [yas](https://wordpress.org/support/users/yas/)
 * (@yas)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/post-icon-plugin/#post-255276)
 * Source code is up: [http://no.oneslistening.com/?p=151](http://no.oneslistening.com/?p=151)
   
   I gave a small explanation of how it works. For those who aren’t as technically
   inclined, I’ll work on a readme file (maybe this will even become a real plugin
   someday).
 * I’ll also see what I can do about writing in an upload function, but time is 
   scarce this time of year, so no guarantees 🙂
 * Let me know if you have any trouble with it, or see any glaring improvements 
   that could be made. As always, feel free to use it, take it apart, put it back
   together, etc – just give credit where credit is due.
 *  Thread Starter [roraz](https://wordpress.org/support/users/roraz/)
 * (@roraz)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/post-icon-plugin/#post-255279)
 * Im reading it now, as well as checking out the source code for the plugin, its
   looking good. I have a couple of questions:
 * is the directory that has to hold images for the post icons /wp-upload/prepic/
   by default?
 * also I notice that in your sidebar of the site that you have a ‘Featured Post’
   section which has the preview picture for that post in it. What I would like 
   to know is there some special code that relies on the plugin to pull up that 
   info, as I was looking to do something similar on my site in my sidebar eg have
   the 3 most recent articles in the sidebar with their pics…
 * also in the sidebar the preview pics dimesions are 100px X 100px, yet when you
   click the link to the article the preview picture in the article is 467px X 135px?
   Im just curious as to how you managed to call up a different sized preview pic
   for the featured post section in the sidebar than the pic in the actual post 
   thats featured?
 *  [yas](https://wordpress.org/support/users/yas/)
 * (@yas)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/post-icon-plugin/#post-255286)
 * That directory is the one that I keep my images in. You can change that to wherever
   you’d like to keep posts (relative to the plugin’s location)
 * The “Featured Post” is actually a separate plugin that works similarly. It stores
   data in the wp_postmeta table for posts that the user selects to be features.
   These are also separate pictures from the ones you find with the_meta_image plugin,
   which is why the dimensions are different. I could provide the source for that
   plugin as well, but it is a bit more complicated since it calls posts randomly(
   it has it’s own query).
 * If you just want to display the most recent three posts with pictures, that’s
   pretty easy with the new query functions in 1.5. You could just use that and 
   use the_meta_image plugin to attach a separate image to the post (just give it
   a different meta key – the plugin uses ‘prepic’ by default, just change that 
   or add another one).
 * Not sure if I’m making good sense.
 *  Thread Starter [roraz](https://wordpress.org/support/users/roraz/)
 * (@roraz)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/post-icon-plugin/#post-255287)
 * cool thanks for that, Ill give it a shot – last question that I’ll probably be
   bothering you with:
 * Ive tried the plugin and it worked great. I put a test pic in the folder (‘postpics’
   which was a sub directory from the main site folder) and changed the plugin code
   to scan the pic directory eg:
 * function select_meta_image() {
    global $post_ID;
 *  $dir = ‘../postpics/’;
 *  and made a test post. Now the pic showed on the main page of the site (in the
   source code it was “postpics/pic.jpg)”) however once I went to the posts page
   the pic wouldn’t show and all I got was the alt text ‘preview page’ ie [http://www.popsacrifice.com/tv-news/2005/08/30/test-page/](http://www.popsacrifice.com/tv-news/2005/08/30/test-page/)
 * Im not all that good with php (I tried changing it myself but I kept getting 
   errors), so how do i make the plugin code put the image source from the root 
   domain eg popsacrifice.com/postpics/ ?
 *  [yas](https://wordpress.org/support/users/yas/)
 * (@yas)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/post-icon-plugin/#post-255288)
 * That’s strange. The path it’s giving your image appears to be correct, but for
   some reason the picture isn’t showing up…
 * Try editing the line:
    `onclick="document.post.'.$meta_form_value.'.value=\''.
   substr($dir,3).$file.'\'`
 * To read:
    `onclick="document.post.'.$meta_form_value.'.value=\'http://www.postsacrifice.
   com/'.substr($dir,3).$file.'\'`
 * It’s not the most robust way to fix the problem, I suppose, but it should work.
 *  Thread Starter [roraz](https://wordpress.org/support/users/roraz/)
 * (@roraz)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/post-icon-plugin/#post-255289)
 * Yeah thanks that worked, though in the edit post area under the bit where it 
   says “The currently assigned preview picture (does not reflect any changes made
   below)” the post picture no longer shows up – but I suppose I can live with that
   =)
 * I wonder why the backslash in front the specified directory was being taken off?
   If it had been on then it doesn’t matter on which page the picture is, it still
   would of appeared eg ‘/postpics/’ as opposed to ‘postpics/’ so it would go from
   the root domain and there wouldn’t have been any need for editing the onclick
   =”…. bit
 * ah well, at least it works =)
 * EDIT: haha that got me thinking, so I changed the code you gave me from:
 * onclick=”document.post.’.$meta_form_value.’.value=\’[http://www.popsacrifice.com/&#8217](http://www.popsacrifice.com/&#8217);.
   substr($dir,3).$file.’\’
 * to:
 * onclick=”document.post.’.$meta_form_value.’.value=\’/’.substr($dir,3).$file.’\’
 * you can see instead of putting ‘[http://www.popsacrifice.com&#8217](http://www.popsacrifice.com&#8217);
   in front of the post pic source it puts in the “missing” backslash ‘/’ which 
   achieves the same effect but means the picture now shows in the admin area.
 *  [yas](https://wordpress.org/support/users/yas/)
 * (@yas)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/post-icon-plugin/#post-255311)
 * Alternatively, you could change it to:
    onclick=”document.post.’.$meta_form_value.’.
   value=\”.substr($dir,2).$file.’\’
 * The substr() function in php basically cuts the ‘../’ off of the directory path.
 *  Thread Starter [roraz](https://wordpress.org/support/users/roraz/)
 * (@roraz)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/post-icon-plugin/#post-255347)
 * I altered the plugin so I could have preview pictures for a recent posts list
   in the sidebar of my site, just like you described how to – and it works
 * however Im having trouble making a recent posts list in the sidebar to include
   the pictures for those posts. I set up a help thread here:
    [http://wordpress.org/support/topic/43952#post-245799](http://wordpress.org/support/topic/43952#post-245799)
   if you have any ideas??
 * Can I take a look at the code for that random posts sidebar plugin that you have,
   that you said was a bit more complex??
 *  [yas](https://wordpress.org/support/users/yas/)
 * (@yas)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/post-icon-plugin/#post-255358)
 * Sorry for the absense from the forum. I can certainly show you the code for the
   feature plugin on my site. It’s a bit hairy and not that pretty, but it works.
 * To accomplish what you want using the metadata function, you’d have to write 
   some PHP – the gurus are right: you can’t include a tag within a tag.
 * If I have some time later tonight I’ll post the code and show you what I mean.

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/post-icon-plugin/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/post-icon-plugin/page/2/?output_format=md)

The topic ‘Post Icon plugin??’ is closed to new replies.

 * 18 replies
 * 3 participants
 * Last reply from: [roraz](https://wordpress.org/support/users/roraz/)
 * Last activity: [20 years, 7 months ago](https://wordpress.org/support/topic/post-icon-plugin/page/2/#post-255425)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
