WordPress Post Information Plugin

This is my first con­tri­bu­tion to the WP com­mu­nity! It is a start, and I hope time per­mit­ting to advance the fea­tures in this plu­gin. This plu­gin aims to con­sol­i­date your post infor­ma­tion into a col­lapsi­ble 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 inter­ac­tion from the main page.

Usage

  1. Down­load, upload, activate.
  2. Add the fol­low­ing code some­where in The Loop.
<?php
if (function_exists('postinfo')) {
  postinfo();
}
?>

Changelog

1.6

  • Fixed word count when using the read more com­mand (was giv­ing word count for excerpt not post).

1.5

  • Added CSS sprite to reduce image flash.

1.4

  • Added JavaScript call­back to des­ig­nate graph­i­cally box can be minimized
  • Changed text for tog­gle to be more descriptive
  • Tweaked CSS

1.3

  • Altered link for com­ments on sin­gle post entries

1.2

  • Added grace­ful degra­da­tion for users with­out JS

1.1

  • Con­verted to jQuery from script.aculo.us (uses jQuery bun­dled with WordPress)
  • Added sup­port for tags
  • Added exten­sive styling includ­ing the famous Fam Fam Silk Icons
  • Reor­ga­nized code

1.0

  • Ini­tial release

Con­sid­er­a­tions

I’ve noticed dif­fer­ent styling results when using the func­tion on sin­gle 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 tog­gle effect and select infor­ma­tion to be dis­played. (Obselete)
  2. Add icons.
  3. Add abil­ity to degrade for users w/o JS enabled.
  4. Clean up plu­gin code.

56 Comments

  1. Nice plu­gin. It looks really good when script­ing is on but unfor­tu­nately it doesn’t degrade grace­fully when it is off. Is it pos­si­ble to make it cater for users with no javascript?

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

    Chris Poteet on 01.17.07
  3. A won­der­ful plu­gin. Except that a new­bie 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 Unwake­able 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 plu­gin. Don’t worry about that now. Just use the instruc­tions I included.

    Chris Poteet on 02.04.07
  5. where can we see a work­ing demo?

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

    Chris Poteet on 11.06.07
  7. very nice plu­gin, look great and use­ful, but for me the prob­leme is, after installing “post infor­ma­tion”, my web­site needs 25 secs more to load. So, I can’t use it, :(

    math on 12.02.07
  8. @Math: Can you acti­vate it, and let me look at the site? I’d like to see what kind of per­for­mance bot­tle­necks come about.

    Chris Poteet on 12.02.07
  9. Hi Chris,

    Thanks for this plu­gin, I’ve acti­vated it on my site and also pasted the code into The Loop. Can’t seem to find the tog­gle effect (do I need to add another piece of code some­where else?)

    I’m a new­bie, sorry for all the questions :)

    L on 12.05.07
  10. @L: I see the “Post Infor­ma­tion” link in your loop. Put the PHP func­tion right where your com­ments link is under­neath the post (the plu­gin 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 plu­gin and would like use it. I tried sav­eral times. But, whether I acti­vate the plu­gin, make the load­ing way longer. too long, I can’t let it acti­vate. 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 under­stand how to find/edit “the loop”.

    Matt on 06.01.08
  15. @Matt: You don’t have to actu­ally edit the loop at all.  Just add the PHP func­tion some­where inside the loop.

    Chris Poteet on 06.01.08
  16. Thanks, got it to work after fur­ther read­ing. I guess i thought this would hide the exist­ing meta, but doesn’t do that for my site template.

    Matt on 06.02.08
  17. @Matt: It is sup­posed to replace it, but just remove it and place the func­tion 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 sug­ges­tions for improve­ment if you’re inter­ested:
    what about an options page where yo ucoudl select what info you want dis­played in the post meta info?
    i.e. I have a blog where only I blog and I have there­fore dis­abled the author archives and the author pages => they redi­rect to the home­page, so I wouldn’t want to dis­plaz that par­tic­u­lar info..

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

    Add an option page to choose the tog­gle effect and select infor­ma­tion to be dis­played. (Obselete)

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

    Chris Poteet on 07.24.08
  23. cool, no prob­lem I was jsut con­fused why you marked it as obso­lete. I thought there might be an option I had not found :-)
     
    still a very cool plugin

    ovidiu on 07.25.08
  24. I am try­ing to imple­ment this plu­gin here: http://www.die-kellerkinder.eu/2008/08/kellerkinder-treffen/
    and I was wod­ner­ing, why it doesn’t say: no com­ments if tehre are no com­ments? any hints?

    ovidiu on 08.11.08
  25. @ovidiu: It’s because it’s on a sin­gle post page, and it doesn’t rec­og­nize that func­tion there.  You could use some logic to check whether it’s a sin­gle post and if so don’t dis­play the code.  It would look some­thing like:
    if (is_single()) { // don’t dis­play }
    else { // display }

    Chris Poteet on 08.11.08
  26. thx, I under­stand your answer, but am con­fused as  Ithought this plu­gin could be used on sin­gle posts? I mean is this page here not a post? Could you explain where its sup­posed to be used?
    I.e. on a home­page 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 plu­gin then explain it.  Upgrade to 1.3.

    Chris Poteet on 08.12.08
  28. thanks a lot. I really appre­ci­ate this, espe­cially given the fact, that you were not going to update this plu­gin any fur­ther :-) works now just fine. Btw. you for­got to change the ver­sion num­ber inside the plu­gin so I guess word­press updates won’t be pick­ing up this update!?
    I just changed your plu­gin to com­pletely skip the com­ments stuff if its on a sin­gle 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 mod­i­fi­ca­tions to your plu­gin so that it also out­puts some infor­ma­tion of these plu­g­ins: 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 look­ing for an icon for the rate this post stuff :-)

    if you want I can share the mods when I am fin­ished, they still need a lit­tle pol­ish­ing, and all echo stuff should be enclosed in IF state­ments to check if those plu­gin sare activated.

    ovidiu on 08.14.08
  31. @ovidiu: Looks good bud. I orig­i­nally 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 run­ning 2.7.1 and it’s work­ing fine.

    Chris Poteet on 03.05.09
  34. Great plu­gin.

    Only thing I noticed that bugs me, and prob­a­bly is IE’s fault, not yours:

    The list in IE inher­its the default styling on an unordered list. So, if you’ve styled your UL with a cus­tom bul­let, 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 look­ing for a solu­tion, just point­ing it out.

    Thanks for the great plugin.

    Mike on 05.08.09
  35. Good catch MIke. Just add the fol­low­ing CSS.

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

    Chris Poteet on 05.08.09
  36. Excel­lent. Worked like a charm. Appre­ci­ate it, and again, thanks for the awe­some plugin!

    Mike on 05.08.09
  37. Damn! Every­thing worked in my site but I removed it for the only rea­son that the .png image for Words didn’t show up. I man­u­ally ver­i­fied that the required png file words.png came with the plu­gin and was installed on the web­server but no luck.

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

    Then I used Win­dows Mag­ni­fier to see if the icon was hid­ing some­where. Yes it was! It was hid­ing behind the ‘Author’ icon.

    Now Chris, how can I get that dis­obe­di­ent icon down and put him where he should be? If you want, i can reen­able the plu­gin in my web­site and show it to you.

    I checked the tick box next to “Notify me of fol­low­ing com­ments via email”. So Chris, if u’re will­ing to help, post a com­ment here. or email me. You already have my email address. Please keep it privated.

    Thanks and wish­ing u all the best with the new job

    GimliGlider on 06.24.09
  38. @GimliGlider: Acti­vate it again, send a URL, and let me know which ver­sion you’re run­ning of the plugin/WordPress.

    Chris Poteet on 06.24.09
  39. hey chris that was nicely exe­cuted. Don’t know of proper words to express my grat­i­tude with. Where the hell is the donate but­ton in your site? LOL seriously???

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

    For read­ers:

    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 hun­dred bucks but why not have a beer on me? :-D Appre­ci­ate your hard work

    GimliGlider on 06.25.09
  42. Hey Chris got a prob­lem. You might have already noticed that I use the short­code in each of my posts to min­i­mize clut­ter in the main page and give the user an option to ‘read more’.

    Prob­lem is: your plu­gin is count­ing words from the begin­ning of a post right till the end of the short­code, and then it is not count­ing words from the rest of the post.

    Is there a way to fix it? Because if not, I’d have to either for­get about using ‘more’ short­code, remove them from all my posts, or remain happy with giv­ing vis­i­tors wrong information.

    Hope you’d look into it. Thanks

    GimliGlider on 06.25.09
  43. @Gimli: I fixed it and pub­lished 1.6.

    Chris Poteet on 06.26.09
  44. wow that was fast man! Just updated and now the words counter is show­ing accu­rate info even with the More short­code inserted. Thanks! Really appre­ci­ate ur help :-D

    GimliGlider on 06.26.09
  45. Hey Chris got a ques­tion, not a fea­ture 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’ sec­tion in Post Infor­ma­tion 1.6? I just tried delet­ing the code that starts with li.tags in .css file and then saw it gone for good but the space it occu­pied still remained. Here’s a screen­shot 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 com­ment 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 per­fectly. Thanks!

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

    Instead of click­ing, how about hov­er­ing? I was 99 per­cent suc­cess­ful in imple­ment­ing that, believe it or not, by sim­ply replac­ing ‘.click’ with ‘.hover’ in line 25 of the file post-information.php.

    the prob­lem with the rest 1% is that when i ‘hover’ out, the post infor­ma­tion win­dow didn’t close. I had to hover on it again to make it close.

    So my ques­tion is: I fairly believe it’s noth­ing 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 call­back event to hide the hover. Here’s the jQuery doc­u­men­ta­tion on the event.

    Chris Poteet on 06.30.09
  50. I did add the code inside thesis:

    thesis/lib/functions/oop_functions.php
    func­tion thesis_loop_posts() {
    if (have_posts()) {
    if (function_exists(‘postinfo’)) {
    postinfo();
    }

    And it works :)

    Lenin on 07.03.09
  51. fixed…added the space code for HTML and the over­lap­ping issue was gone :)

    GimliGlider on 07.04.09
  52. is there a way i can edit the date and stuff to my own values

    rage on 08.28.09
  53. @rage: Yes, you can edit the plu­gin file to use what­ever you’d like.

    Chris Poteet on 09.04.09
  54. I’m lov­ing this plu­gin because not only it’s help­ful for the vis­i­tors and authors of the site but also it adds that aes­thetic beauty too. Well, I’m not so lucky with it yet on my site… it just come out all bro­ken up and not show­ing good at all. Please take a look at http://www.xpozeet.com. Maybe you can give me some advice on how to fix it. Thanks for such a nice plug.

    Ron Franc on 10.29.09
  55. @Ron: Thanks for the kind words. I looked, and you have a lot of JS being loaded includ­ing dif­fer­ent libraries (Mootools, jQuery). My code runs in com­pat­i­bil­ity mode, but I’d guess some­thing is con­flict­ing with another JS plu­gin. Try and remove all and re-add until you find out which one breaks everything.

    Chris Poteet on 10.29.09
  56. @ Chris: The theme I’m using actu­ally came embed­ded with a set of JS so it’s gonna be hard to deter­mine what’s caus­ing this because i have very lit­tle knowl­edge in that depart­ment.
    I just went to your Con­tact link to make an offer to you to help me fix it but I real­ize that you are no longer tak­ing on WP/Web Design. Well, I’ll deac­ti­vate it for now, maybe some­one will come along and know a fix. Thanks for the plug and response.

    Ron Franc on 10.30.09

36 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
  3. By jQuery Wordpress Plugins | WPThemesPlugin.com on August 2, 2009 at 5:39 pm
  4. By Disha Hosting » jQuery Wordpress Plugins on August 4, 2009 at 10:55 am
  5. By tmtbox media | jQuery Wordpress Plugins on August 5, 2009 at 4:21 pm
  6. By jQuery Wordpress Plugins : CRshare.com on August 7, 2009 at 4:45 pm
  7. By My Blog on August 24, 2009 at 12:13 am
  8. By prueba 2 : My Blog on August 24, 2009 at 12:27 am
  9. By BlogoTips » jQuery Plugins for Wordpress on September 25, 2009 at 10:09 am
  10. By jquery wordpress plugins – part 1 | DexTech on November 27, 2009 at 10:12 pm
  11. By 9 Wordpress Plugin with Jquery | denbagus blog on December 8, 2009 at 9:07 am
  12. By 11 Useful jQuery Powered WordPress Plugins | WebsGeek on February 23, 2010 at 10:26 pm

Got Something to Say?

(Required)
(Required)