WordPress Post Information Plugin

This is my first contribution to the WP community! It is a start, and I hope time permitting to advance the features in this plugin. This plugin aims to consolidate your post information into a collapsible panel (using jQuery) that can save space on your page.

You can see what it looks like below on this post, and you can test the interaction from the main page.

Usage

  1. Download, upload, activate.
  2. Add the following code somewhere in The Loop.
<?php
if (function_exists('postinfo')) {
  postinfo();
}
?>

Changelog

1.6

  • Fixed word count when using the read more command (was giving word count for excerpt not post).

1.5

  • Added CSS sprite to reduce image flash.

1.4

  • Added JavaScript callback to designate graphically box can be minimized
  • Changed text for toggle to be more descriptive
  • Tweaked CSS

1.3

  • Altered link for comments on single post entries

1.2

  • Added graceful degradation for users without JS

1.1

  • Converted to jQuery from script.aculo.us (uses jQuery bundled with WordPress)
  • Added support for tags
  • Added extensive styling including the famous Fam Fam Silk Icons
  • Reorganized code

1.0

  • Initial release

Considerations

I’ve noticed different styling results when using the function on single post pages and the loop on other pages. Be sure to test both for differences.

To Do

  1. Add an option page to choose the toggle effect and select information to be displayed. (Obselete)
  2. Add icons.
  3. Add ability to degrade for users w/o JS enabled.
  4. Clean up plugin code.

49 Comments

  1. Nice plugin. It looks really good when scripting is on but unfortunately it doesn’t degrade gracefully when it is off. Is it possible to make it cater for users with no javascript?

    Rob on 01.17.07
  2. @Rob: Yikes! I completely missed that one. I’ll have to add that in the next release.

    Chris Poteet on 01.17.07
  3. A wonderful plugin. Except that a newbie like me doesn’t know what you mean by adding an option page. Did you mean add another file, like postinfo.php? I’m using the Unwakeable theme, and it has an options folder. Put this postinfo.php inside this folder? I’m so confused. :(

    Can on 02.04.07
  4. @Can: It’s a page where you can set options for the plugin. Don’t worry about that now. Just use the instructions I included.

    Chris Poteet on 02.04.07
  5. where can we see a working demo?

    G on 11.06.07
  6. @G: I posted a demo, but keep in mind some of the elements won’t show up because it’s inside the post.

    Chris Poteet on 11.06.07
  7. very nice plugin, look great and useful, but for me the probleme is, after installing “post information”, my website needs 25 secs more to load. So, I can’t use it, :(

    math on 12.02.07
  8. @Math: Can you activate it, and let me look at the site? I’d like to see what kind of performance bottlenecks come about.

    Chris Poteet on 12.02.07
  9. Hi Chris,

    Thanks for this plugin, I’ve activated it on my site and also pasted the code into The Loop. Can’t seem to find the toggle effect (do I need to add another piece of code somewhere else?)

    I’m a newbie, sorry for all the questions :)

    L on 12.05.07
  10. @L: I see the “Post Information” link in your loop. Put the PHP function right where your comments link is underneath the post (the plugin has a link to the comments).

    Chris Poteet on 12.05.07
  11. Thanks Chris,

    It works now!

    L on 12.05.07
  12. thx for answer. I really like your plugin and would like use it. I tried saveral times. But, whether I activate the plugin, make the loading way longer. too long, I can’t let it activate. any idea, where it can be from ?

    math on 12.15.07
  13. @Math: It does load some JavaScript libraries which could be it. I really do need to see it to troubleshoot.

    Chris Poteet on 12.16.07
  14. I tried using this, but I guess I don’t understand how to find/edit “the loop”.

    Matt on 06.01.08
  15. @Matt: You don’t have to actually edit the loop at all.  Just add the PHP function somewhere inside the loop.

    Chris Poteet on 06.01.08
  16. Thanks, got it to work after further reading. I guess i thought this would hide the existing meta, but doesn’t do that for my site template.

    Matt on 06.02.08
  17. @Matt: It is supposed to replace it, but just remove it and place the function where it used to live.

    Chris Poteet on 06.02.08
  18. Cool, got it. Thanks for your insight Chris.

    Matt on 06.02.08
  19. Nice man, thanks alot

    Shah Hussain Khan on 07.05.08
  20. jsut soem suggestions for improvement if you’re interested:
    what about an options page where yo ucoudl select what info you want displayed in the post meta info?
    i.e. I have a blog where only I blog and I have therefore disabled the author archives and the author pages => they redirect to the homepage, so I wouldn’t want to displaz that particular info..

    ovidiu on 07.24.08
  21. sorry just noticed that was #1 on your to do list, but why woudl that be obsolete?
     
    To Do

    Add an option page to choose the toggle effect and select information to be displayed. (Obselete)

    ovidiu on 07.24.08
  22. @ovidu: It’s obselete, because I’m not going to do it.

    Chris Poteet on 07.24.08
  23. cool, no problem I was jsut confused why you marked it as obsolete. I thought there might be an option I had not found :-)
     
    still a very cool plugin

    ovidiu on 07.25.08
  24. I am trying to implement this plugin here: http://www.die-kellerkinder.eu/2008/08/kellerkinder-treffen/
    and I was wodnering, why it doesn’t say: no comments if tehre are no comments? any hints?

    ovidiu on 08.11.08
  25. @ovidiu: It’s because it’s on a single post page, and it doesn’t recognize that function there.  You could use some logic to check whether it’s a single post and if so don’t display the code.  It would look something like:
    if (is_single()) { // don’t display }
    else { // display }

    Chris Poteet on 08.11.08
  26. thx, I understand your answer, but am confused as  Ithought this plugin could be used on single posts? I mean is this page here not a post? Could you explain where its supposed to be used?
    I.e. on a homepage inside the loop or where else could I use this plugin?

    ovidiu on 08.11.08
  27. @ovidiu: It’s your lucky day. It would take less time to update the plugin then explain it.  Upgrade to 1.3.

    Chris Poteet on 08.12.08
  28. thanks a lot. I really appreciate this, especially given the fact, that you were not going to update this plugin any further :-) works now just fine. Btw. you forgot to change the version number inside the plugin so I guess wordpress updates won’t be picking up this update!?
    I just changed your plugin to completely skip the comments stuff if its on a single page :-)

    ovidiu on 08.12.08
  29. @ovidiu: You’re right. Fixed now. Thanks.

    Chris Poteet on 08.12.08
  30. just wanted to let you know I made some modifications to your plugin so that it also outputs some information of these plugins: http://lesterchan.net/portfolio/programming/

    you can check it out here: http://www.die-kellerkinder.eu/2008/08/formula-returns/
    I inserted email this post, print this post and rate this post, but I am still looking for an icon for the rate this post stuff :-)

    if you want I can share the mods when I am finished, they still need a little polishing, and all echo stuff should be enclosed in IF statements to check if those plugin sare activated.

    ovidiu on 08.14.08
  31. @ovidiu: Looks good bud. I originally did have the WP-Email link in there but later decided to remove it.

    Chris Poteet on 08.14.08
  32. wp 2.7.1 ?!

    eilia on 03.05.09
  33. I’m running 2.7.1 and it’s working fine.

    Chris Poteet on 03.05.09
  34. Great plugin.

    Only thing I noticed that bugs me, and probably is IE’s fault, not yours:

    The list in IE inherits the default styling on an unordered list. So, if you’ve styled your UL with a custom bullet, etc, it shows in front of the fam fam fam icons in the plugin.

    Works fine in every other browser I’ve tried, just not in IE.

    Not looking for a solution, just pointing it out.

    Thanks for the great plugin.

    Mike on 05.08.09
  35. Good catch MIke. Just add the following CSS.

    .post-info ul {
    list-style: none;
    }

    Chris Poteet on 05.08.09
  36. Excellent. Worked like a charm. Appreciate it, and again, thanks for the awesome plugin!

    Mike on 05.08.09
  37. Damn! Everything worked in my site but I removed it for the only reason that the .png image for Words didn’t show up. I manually verified that the required png file words.png came with the plugin and was installed on the webserver but no luck.

    Also went into the CSS file to see if the image was properly linked. Yes it was properly linked but the image didn’t show up.

    Then I used Windows Magnifier to see if the icon was hiding somewhere. Yes it was! It was hiding behind the ‘Author’ icon.

    Now Chris, how can I get that disobedient icon down and put him where he should be? If you want, i can reenable the plugin in my website and show it to you.

    I checked the tick box next to “Notify me of following comments via email”. So Chris, if u’re willing to help, post a comment here. or email me. You already have my email address. Please keep it privated.

    Thanks and wishing u all the best with the new job

    GimliGlider on 06.24.09
  38. @GimliGlider: Activate it again, send a URL, and let me know which version you’re running of the plugin/WordPress.

    Chris Poteet on 06.24.09
  39. hey chris that was nicely executed. Don’t know of proper words to express my gratitude with. Where the hell is the donate button in your site? LOL seriously???

    GimliGlider on 06.25.09
  40. @GlimGlider: I have a donate button on this page, but it’s not necessary.

    For readers:

    He needed to add a clear to the last list item.

    li.words {
    clear: left;
    }

    Chris Poteet on 06.25.09
  41. thanks so much chris. Just donated! I’m not rich so I couldn’t afford to donate a hundred bucks but why not have a beer on me? :-D Appreciate your hard work

    GimliGlider on 06.25.09
  42. Hey Chris got a problem. You might have already noticed that I use the shortcode in each of my posts to minimize clutter in the main page and give the user an option to ‘read more’.

    Problem is: your plugin is counting words from the beginning of a post right till the end of the shortcode, and then it is not counting words from the rest of the post.

    Is there a way to fix it? Because if not, I’d have to either forget about using ‘more’ shortcode, remove them from all my posts, or remain happy with giving visitors wrong information.

    Hope you’d look into it. Thanks

    GimliGlider on 06.25.09
  43. @Gimli: I fixed it and published 1.6.

    Chris Poteet on 06.26.09
  44. wow that was fast man! Just updated and now the words counter is showing accurate info even with the More shortcode inserted. Thanks! Really appreciate ur help :-D

    GimliGlider on 06.26.09
  45. Hey Chris got a question, not a feature request or bug: If u haven’t noticed already, I don’t use tags in my site at all because I don’t really get the point. Is there a very easy way to get rid of the ‘Tags’ section in Post Information 1.6? I just tried deleting the code that starts with li.tags in .css file and then saw it gone for good but the space it occupied still remained. Here’s a screenshot of what I saw: twitpic.com/8ie96/full (please add http:// before the URL ’cause I can’t do it here cause if i do my comment will be likely detected as spam)

    GimliGlider on 06.26.09
  46. @Gimli: I can add that option in a future release. For now you can remove lines 47-48 in the PHP file.

    Chris Poteet on 06.27.09
  47. that worked perfectly. Thanks!

    GimliGlider on 06.27.09
  48. how u doing chris? Hope everything’s fine with you. I was wondering…

    Instead of clicking, how about hovering? I was 99 percent successful in implementing that, believe it or not, by simply replacing ‘.click’ with ‘.hover’ in line 25 of the file post-information.php.

    the problem with the rest 1% is that when i ‘hover’ out, the post information window didn’t close. I had to hover on it again to make it close.

    So my question is: I fairly believe it’s nothing but a few more words I would need to add or replace a bit above or below line 25. Can you give me a hint?

    Thanks once again :P

    GimliGlider on 06.30.09
  49. You have to add a callback event to hide the hover. Here’s the jQuery documentation on the event.

    Chris Poteet on 06.30.09

15 Trackbacks

  1. By BlogBroker » WordPress Plugin Releases for 11/6 on November 12, 2007 at 3:32 am
  2. By Post Information_Wordpress plugin on January 23, 2008 at 3:38 am

Got Something to Say?

(Required)
(Required)