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.

119 Responses

  1. Chris Poteet June 25, 2009 / 3:24 pm

    @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;
    }

  2. GimliGlider June 25, 2009 / 3:32 pm

    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

  3. GimliGlider June 25, 2009 / 10:54 pm

    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

  4. Chris Poteet June 26, 2009 / 9:06 pm

    @Gimli: I fixed it and published 1.6.

  5. GimliGlider June 26, 2009 / 9:40 pm

    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

  6. GimliGlider June 26, 2009 / 10:58 pm

    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)

    • Chris Poteet June 27, 2009 / 1:44 pm

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

  7. GimliGlider June 27, 2009 / 1:52 pm

    that worked perfectly. Thanks!

  8. GimliGlider June 30, 2009 / 8:37 am

    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

  9. Lenin July 3, 2009 / 9:17 am

    I did add the code inside thesis:

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

    And it works :)

  10. GimliGlider July 4, 2009 / 1:31 am

    fixed…added the space code for HTML and the overlapping issue was gone :)

  11. Pingback: My Blog
  12. Pingback: prueba 2 : My Blog
  13. rage August 28, 2009 / 9:35 pm

    is there a way i can edit the date and stuff to my own values

    • Chris Poteet September 4, 2009 / 12:46 am

      @rage: Yes, you can edit the plugin file to use whatever you’d like.

  14. Ron Franc October 29, 2009 / 7:29 pm

    I’m loving this plugin because not only it’s helpful for the visitors and authors of the site but also it adds that aesthetic beauty too. Well, I’m not so lucky with it yet on my site… it just come out all broken up and not showing 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.

    • Chris Poteet October 29, 2009 / 8:33 pm

      @Ron: Thanks for the kind words. I looked, and you have a lot of JS being loaded including different libraries (Mootools, jQuery). My code runs in compatibility mode, but I’d guess something is conflicting with another JS plugin. Try and remove all and re-add until you find out which one breaks everything.

  15. Ron Franc October 30, 2009 / 6:23 am

    @ Chris: The theme I’m using actually came embedded with a set of JS so it’s gonna be hard to determine what’s causing this because i have very little knowledge in that department.
    I just went to your Contact link to make an offer to you to help me fix it but I realize that you are no longer taking on WP/Web Design. Well, I’ll deactivate it for now, maybe someone will come along and know a fix. Thanks for the plug and response.

  16. Dave May 3, 2010 / 10:21 pm

    Very nice thank you took me a while to find the loop but it new it couldent hide forever lol
    Thank You
    Great Plugin
    Dave

  17. Pingback: Post Information
  18. Pingback: Post Information
  19. Patrick September 6, 2010 / 11:47 am

    where is “the loop”???
    Thanks

    • Chris Poteet September 7, 2010 / 2:11 pm

      @Phillip: In your theme it starts with something that looks like this in your theme’s files.
      php if ( have_posts() ) : while ( have_posts() ) : the_post();
      Check out this about the Loop on the WordPress Codex.

  20. Let May 4, 2011 / 7:04 am

    Hi, I’ve installed your plugin in my website, but when I click on the icon the div opens but then it hides in less than a second.

    This is my website – http://www.lesenfantsterribles.org/ – if you look at any posts, the result is every time the same. The content is show but when the div reaches the bottom its close again.

    Could you help me?

    Thanks, Let

    • Chris Poteet May 4, 2011 / 4:25 pm

      You’ve got a bunch of JavaScript plugins. I’m going to assume one of them is colliding in some way with mine. Try deactivating one by one the plugins that use jQuery to see where the collision is.

Comments are closed. If you have a question please contact me.