WordPress.org

Ready to get started?Download WordPress

Forums

New Plugin: WP-SNAP! (20 posts)

  1. nateomedia
    Member
    Posted 8 years ago #

    About a year ago, I had need to create a glossary of terms category in WordPress and had to create a navigation system that allowed terms to be displayed based on their first letter. At the time I was pretty new to PHP (heck, I still am!), so I was lucky to find a thread on here (this one: http://wordpress.org/support/topic/12379 ) that gave me the code I needed to build the system.

    Last weekend, I got an email from someone asking how I got the code to work and I went back to the support thread and discovered that several others had also asked the same question. Rather than take 5 minutes to post some follow-up helpful hints, I spent the last 3 days writing my first WordPress Plugin. :)

    If anyone would like to test this plugin for me, or just glance over the code and critique my style, I would be most appreciative.

    http://www.nateomedia.com/wordpress/wp-snap

  2. nateomedia
    Member
    Posted 8 years ago #

    Hot on the heels of WP-SNAP! v0.1 comes version 0.2. Surprisingly, this is not a bug fix, but a feature enhancement. After reading this thread, I realized that I could very easily modify my plugin to allow you to pre-select the category to be displayed. While not very useful (and perhaps confusing to users) on a Category page, it could be very useful on a Page... uh, page.

    In new version 0.2, you can pass a category to WP-SNAP! thusly:

    <?php echo wp-snap('0'); ?>

    Grab it here: http://www.nateomedia.com/wordpress/wp-snap

  3. nateomedia
    Member
    Posted 8 years ago #

    I hear... crickets chirping. Well, I hope someone is finding this plugin useful.

    I have two thoughts for additional features I could implement, but it would be nice to know someone was interested:

    1. (Easy) An option to include the children of the current category in the displayed results.
    2. (Harder) An option to include a numerical paging system at the bottom of the displayed results and the ability to set a hard limit of the number of posts displayed at a time. For instance, say there are 28 posts with titles starting with the letter "B" -- one could set a hard limit on displaying 10 post title results per page, with a numerical menu at the bottom something like this:

    < Previous ... 18 | 19 | 20 | 21 | 22 ... Next >

    The last page of "B" results might even include 2 "C" results, and clicking on the next page might finished the "C"s and start the "D"s. Etc.

    Hopefully I'm making some sense. Any interest in something like that?

  4. lellie
    Member
    Posted 8 years ago #

    ooo that looks very very helpful.. I currently group a newpaper by issues and you can look at an issue archive through an alphabetical list.. would be a useful addition

  5. NyaHalcyon
    Member
    Posted 8 years ago #

    This is a nice plugin, indeed - I installed it today on my one and only category page and it works perfectly. Now I find myself wondering how to configure the layout of it, though.

    What I would like to do is to have the menu display in a box inside the sidebar (one I created for the category display only), so it would basically show up as
    a-d
    e-h
    etc...

    but only below the titles. Any hint on how I could achieve that?

  6. nateomedia
    Member
    Posted 8 years ago #

    If you want them to display vertically in a box as you've shown, you'll want to add something like this to your style.css file:

    #divname ol.snap_nav {
    padding: 8px 8px 5px 8px
    border: 1px solid #000;
    text-align: center;
    }

    #divname ol.snap_nav li {
    margin-bottom: 3px;
    display: block;
    }

  7. NyaHalcyon
    Member
    Posted 8 years ago #

    Okidoke, now I just have to get my site to cooperate... thanks for the help, I really love this plugin since it's helped me make some of my ideas come true.

  8. nateomedia
    Member
    Posted 8 years ago #

    I'm glad you like it. Please let me know if you have any suggestions for making it better.

  9. NyaHalcyon
    Member
    Posted 8 years ago #

    Okay, a quick question - how do I tweak the code so the titles and everything else doesn't show up with the bullets in front of them?

    If you go to http://nyahalcyon.net/archives/category/le-cuisine/ you will see what I mean. I'd like to get the nav list to be in the exact center, maybe even two (a-d e-h, etc) next to each other in one line, and then underneath the titles displayed with maybe 2px padding between the side of the box and the text.

    Sorry, my list html and css is a bit rusty. Enough for ordinary purposes but I am too afraid of changing the code around in the Plugin itself (the one time I did I got myself a nasty SQL error)

  10. NyaHalcyon
    Member
    Posted 8 years ago #

    Or now I've had a better idea: Would it be possible to have the alphabetical index on the left side in that box in the sidebar, and the titles displayed underneath the one single post?

  11. nateomedia
    Member
    Posted 8 years ago #

    There should be no need to change the code in the plugin to get the results you desire. It can all be done through css. To remove the numbers:

    #navigation ol.snap_nav li {
    list-style: none;
    }

    I suggest that you get yourself a book on css -- Cascading Style Sheets 2.0: Programmer's Reference by Eric A. Meyer would be a great place to start.

  12. nateomedia
    Member
    Posted 8 years ago #

    I've updated WP-SNAP! to version 0.3. I've improved how the plugin handles post excerpts. Now, if the plugin finds that a post's excerpt field is empty, it will create an excerpt from the post content. The length of the excerpt can be controlled from the plugin's options menu in the admin interface.

    WP-SNAP! v0.3

  13. nateomedia
    Member
    Posted 8 years ago #

    I fixed a bug with the navigational menu and have updated WP-SNAP! to version 0.3.1.

    WP-SNAP! v0.3.1

  14. nateomedia
    Member
    Posted 8 years ago #

    I've update WP-SNAP! to version 0.4. It no longer chokes on post entries beginning with non-alphanumeric characters (i.e., a quotation mark, ampersand, percentage symbol, etc.).

    WP-SNAP! v0.4

  15. sickn3ss
    Member
    Posted 8 years ago #

    hey how did you make those scrolling text box things like in this picture:

    http://img158.imageshack.us/img158/1674/untitled8iq.png

    I want to be able to do that on my site so the text doesnt move outside into the sidebar

  16. nateomedia
    Member
    Posted 8 years ago #

    WP-SNAP! has been updated to version 0.5. It is now possible for the user to define words (such as "the" or "an") to be ignored when alphabetizing posts.

    WP-SNAP! v0.5

  17. nateomedia
    Member
    Posted 8 years ago #

    WP-SNAP! has been updated (finally) to version 0.5.2. Just trying to kill a few bugs for now, but if you're using this plugin you probably want to try this version.

    WP-SNAP! v0.5.2

  18. nateomedia
    Member
    Posted 7 years ago #

    WP-SNAP! has had a couple more minor updates, bringing us to version 0.5.4.

    WP-SNAP! v0.5.4

    Lorelle was also kind enough to do a little review my plugin, you can take a look at that here.

  19. nateomedia
    Member
    Posted 7 years ago #

    WP-SNAP! has once again been updated! I've completely changed how posts are displayed in this version, pushing that duty back onto the WordPress Loop. WP-SNAP! version 0.6 can be found here:

    WP-SNAP! v0.6

    Enjoy!

  20. vkaryl
    Member
    Posted 7 years ago #

    Thanks - just have a client asking about this, hadn't heard of it before....

Topic Closed

This topic has been closed to new replies.

About this Topic