WP-SNAP! WordPress Plugin
What Is WP-SNAP!?
WP-SNAP! (WordPress System for Navigating Alphabetized Posts) creates an alphabetical listing of post titles on a Category or Page template file. Navigation through the listings WP-SNAP! generates is accomplished using the alphabet itself. (For example, if a site visitor clicked on the letter D, any post titles that began with that letter would be showcased.) WP-SNAP! will work on any Wordpress 2.1.x or higher site, but is particularly useful managing glossaries, indexes, reviews, or directories. Since it is said that a picture is worth a thousand words, here’s a screenshot of WP-SNAP! in action:

WP-SNAP! offers three different navigational styles and integration with both custom permalinks and the Wordpress loop. Plugin options can be managed both site-wide and on the template itself with results either restricted to one category or broadened to include child categories as well. The clever web developer should have no problem seamlessly integrating WP-SNAP! into their latest project. Options have also been added to allow the customization of css class names and the appearance of html mark-up.
How To Configure WP-SNAP!
- Click on the link to the right to download the WP-SNAP! WordPress Plugin, extract it and upload it to your WordPress Plugins folder on your site.
- Activate the Plugin from the WordPress Administration Plugins tab.
- Edit the category templates your Theme uses, such as category.php, and add the following code above the start of the Wordpress Loop:
<?php if (function_exists('wp_snap')) { echo wp_snap(); } ?> - Copy the CSS example below and paste it into your WordPress Theme stylesheet (you can style it better later).
- Upload the files and refresh the category page on your WordPress blog to see it in action.
- For further customization, go to the Plugins > WP-SNAP! panel and change the alphabetical structure to something different and click Update Options. You may also change the categories to be displayed and the menu navigational structure by passing variables as a query-string to the plugin like so:
<?php if (function_exists('wp_snap')) { echo wp_snap('arguments'); ?>There are currently four possible arguments: Category (’cat’), Include Category Children (’child’), Navigational Menu Style (’menu’), and First Load (’firstload’). Category must equal a category number from your WordPress installation, Include Category Children must equal true or false as to whether to include child categories (the default value is false), Navigational Menu Style must equal a number between 1 and 3 (corresponding with the three navigational styles offered in the admin options panel), and First Load must equal ALL, NONE or RECENT and will affect how WP-SNAP! displays posts/tags when it is first called on a template. Note that if RECENT is selected, the number of recent posts/tags to display can be controlled from the admin options page. For instance, to create a navigational menu for all posts in category 15, including child categories, using the default menu navigational style, and displaying recent posts on first load, WP-SNAP! would be called like this:
<?php if (function_exists('wp_snap')) { echo wp_snap('cat=15&child=true&firstload=recent'); } ?>To create a navigational menu for the current category, excluding child categories and using navigational menu style 3, WP-SNAP! would be called like this:
<?php if (function_exists('wp_snap')) { echo wp_snap('menu=3'); } ?>To create a navigational menu for all categories, using default navigational menu style, WP-SNAP! would be called like this:
<?php if (function_exists('wp_snap')) { echo wp_snap('cat=all'); } ?> - Test it out and enjoy!
Note: For the Plugin to work, you must have access to edit your WordPress Theme files. You must also have a category.php template file in your WordPress Theme. If you do not, you can create one following the instructions on the WordPress Codex for creating a category template file.
CSS Styling
It should be noted that this plugin does not inject any css styling information, so it is up to the user to add the appropriate class information to the Wordpress Theme css stylesheet. Here is some sample code to get you started:
ol.snap_nav {
display: inline;
float: left;
clear: both;
list-style: none;
}
ol.snap_nav li {
display: block;
float: left;
padding: 0 2px 10px 0;
}
ol.snap_nav li a {
font-weight: bold
}
ol.snap_nav li.snap_selected a {
cursor: text;
}
ol.snap_titles {
clear: both;
display: block;
border: 0;
list-style: none;
}
Feedback
This plugin thrives on user feedback. Praise, ideas, and bug reports are all welcome. Use the comment form below to let me know what you think. Please keep in mind that I am not paid to work on this plugin and that delays between updates can and will occur. Please do not post questions about when the next update will be released. I appreciate your enthusiasm, but your comment will be deleted. If there is a significant delay between releases, I try to post a timeframe of when the next update can be expected.
Thank You
My thanks to Lorelle VanFossen for reviewing my plugin and allowing me to reuse her instructions on this page.
Change Log
- 06.2008.10 Version 0.8.5
- Added international language file support
- Changed the method for passing data to the plugin
- Tracked down bugs
- 06.2008.08 Version 0.8.4
- Made the plugin compatible with Wordpress’s new tagging system
- Corrected problem with listing recent posts
- 04.2008.03 Version 0.8.3
- Fixed a small — but significant — typo
- Moved the administrative submenu to plugins.php
- Added the ability to display All/None/Recent posts on first load
- 12.2007.02 Version 0.8.1
- Fixed incompatibility with PHP 4
- 11.2007.28 Version 0.8
- Added support for fancy URLs
- 10.2007.04 Version 0.7.3
- Fixed error with Wordpress 2.3 database call
- 09.2007.28 Version 0.7.2
- Made database call compatible with Wordpress 2.3
- 06.2007.02 Version 0.7.1
- Fixed error with database call
- 05.2007.30 Version 0.7
- Fixed issue preventing the display of more than 10 posts
- Fixed issue with sorting uppercase/lowercase post titles
- Restored ability to pass a category to the plugin
- Added ability to include category children in returned results
- Added ability to display all categories
- Added ability to change navigation style when calling the plugin
- Added support for Gengo (hopefully)
- 05.2007.12 Version 0.6.2
- Restored the ability to exclude first words from being alphabetized
- Cleaned-up some instructional text in the options menu
- 01.2007.21 Version 0.6.1
- Fixed a minor error with the $wp_snap_category variable
- 01.2007.20 Version 0.6
- Rebuilt the entire plugin to be better, stronger, faster
- Changed how results are displayed; plugin now plays well with the Wordpress loop
- Removed option to pass a category number directly to the plugin, making it incompatible with Pages (feature to return if requested)
- Added nonce protection to the admin options panel
- Added option to group posts beginning with a number under ‘#’
- Fixed unencoded ampersands
- 09.2006.20 Version 0.5.4
- Updated WP-SNAP! to ignore posts with post-dated timestamps
- 08.2006.02 Version 0.5.3
- Fixed an error that affected certain navigational menu styles
- 08.2006.01 Version 0.5.2
- Updated alphabetization to accomodate accent marks; still needs refinement
- Fixed a logic error with the post title sort loop
- 06.2006.07 Version 0.5.1
- Squashed some bugs in the new ignore filter
- 06.2006.06 Version 0.5
- Words can now be filtered from the alphabetization process from the WP-SNAP! admin options menu
- 06.2006.01 Version 0.4
- Added ‘#’ to catch category entries beginning with non-alphanumeric characters
- Tweaked the code here and there
- Fixed the WP-SNAP! plugin url on the admin options page
- 05.2006.13 Version 0.3.1
- Fixed the url structure of the navigation when used on a Page
- Added ‘apply_filters’ to the post excerpt
- 05.2006.08 Version 0.3
- Plugin no longer displays excerpts for password protected posts, if the viewer is unauthorized
- If there is no excerpt for a post and excerpts are turned on, plugin now creates an excerpt from the post content
- Fixed a typo
- 03.2006.29 Version 0.2
- Added the ability to pass a category number directly to the plugin, making WP-SNAP compatible with Pages
- 03.2006.29 Version 0.1
- Initial Release
Hello Nathan–
I was looking at using your plugin to create an alphabetized archive page. Unfortunately, the plugin generated 4 “headers already sent errors” and was then inaccessible from the Plugin management page. I had to delete it and never got the chance to take it for a spin. Offhand, do you know what might have caused the errors? The warnings were on lines 11, 12, 13, 14. Comments. I removed the comments, but the same error was generated. WP 1.5.2. Any ideas?
cheers
SAM :)
March 29th, 2006 at 3:46 pm
Sam —
After doing a bit of research, it seems that header errors are most likely the result of “spaces, new lines, or other garbage before an opening <?php tag or after a closing ?> tag.” My guess is that you copied and pasted this plugin into a new document and accidently left extra spaces in the document. I suggest that you re-download the plugin by right-clicking on the above link and saving it to your drive. Thank you for your feedback!
March 29th, 2006 at 3:52 pm
Thanks! There was indeed one space after the closing ?>. Thanks for your quick response!
March 29th, 2006 at 6:50 pm
Where i put the plugin code?
archive? single post?
March 30th, 2006 at 9:33 am
Every attempt to activate the plugin returns a blank page for my blog. I have downloaded several times to avoid the problem you mentioned above.
March 30th, 2006 at 10:46 am
Very cool. Just what I was looking for. Going to use it for software reviews for my friends and Dad. They are always asking me what software does this or tha, or what a particular piece of software I am using. This will work nicely on the cat page I made. Thanks!
March 30th, 2006 at 12:00 pm
Roberlan — for most themes, you would place the code in your category.php file. That’s the only way to get it to work in it’s default mode. But it’s really up to you. Where do you want your list of post titles to appear? It should work just about anywhere, as long as you pass a category number to it.
andre — If you would like me to help you resolve the issue you are encountering, you will have to be a little more specific. How are you trying to “activate” the plugin? Do you mean from within your WordPress admin interface? Or when you place the wp-snap() function on the page? In which file are you placing the function? Where in the file are you placing it? If it’s one besides category.php, you’ll have to pass a category number to it.
z — Thank you very much for the feedback. It’s great to hear that someone has found use for this!
March 30th, 2006 at 2:54 pm
nateo
I haven’t been able to get past activating in the admin interface. I dl’ed the wp-.phps file upload to my plugin directory rename wp-snap.php. Then go the the admin interface click activate then I get blank page. if I remove the wp-snap.php everything goes back to normal. I’m running WP 2.01 on a unix box
March 31st, 2006 at 5:57 am
hey nate, thanks for the answer, but in my wp installation (wp2.0.2) i don´t have “category.php” file. I can´t figure it out where to put the code…
Anyway, thanks for the answer
:)
March 31st, 2006 at 9:51 am
andre — Off the top of my head, my first thought is that you’re having a conflict with another plugin. It would be helpful to know if you still get the blank page when you turn off all other plugins. If the blank page goes away, if you could let me know what plugins you’re using, I’ll see if I can figure out what the conflict is and fix it! Thanks!
Roberlan — The “category.php” page would be in your theme files. So you’d go to /wp-content/themes/default/ to find category.php.
April 1st, 2006 at 12:00 am
nateo I found the conflict I think it was with a plugin caled book review when I removed that wp-snap activated fine. Is a horizontal list an option?
April 1st, 2006 at 6:47 am
andre — I’ll look up “book review” and see if I can figure out why it’s a conflict. Thanks for the heads up. Yes, the list can be made horizontal, you just have to add some code to your style.css file in your theme. Unfortunately, a css tutorial kind of goes beyond the scope of this plugin, but I did provide some sample css rules above. You’ll probably find that those rules will work better if you append the div id or class in which they are contained. For instance, if your php code looks like this:
Then change the above styles to begin like this:
April 1st, 2006 at 1:28 pm
[...]   WP-SNAP!,æä¾›æŒ‰å—æ¯æŽ’åˆ—æ–‡ç« çš„å¯¼èˆªæ¡ã€‚ alphabetized navigating å—æ¯ å¯¼èˆªæ¡ [...]
April 2nd, 2006 at 4:40 am
Hello,
I am trying to organize a list of museums on a protected install of WP that I use to organize the notes for my doctorate. I want to display a single category of entries (cat # 15). I tried the syntax that you post …
… but it did not work. What am I doing wrong? How can I get it to work because this is perfect for what I am to do?April 20th, 2006 at 6:33 am
Hello Thad —
You didn’t mention in your post how WP-SNAP! failed, so it’s difficult for me to suggest a solution. Is your problem that you can’t isolate it to a single category? Or that it’s not working at all?
If you are using the default theme, go to your archive.php file and starting at line 32, change your code to something like this:
That should get WP-SNAP! to display for the correct category, but you’ll probably want to clean things up a bit after that — maybe add a div container around it, include more html code in the else statement so that you don’t get full post entries displaying for category 15.
Hope that helps.
April 20th, 2006 at 10:09 am
nateo -
Thanks! That fixed it! Cheers!
Sorry about not describing the problem in too much detail …
But, thanks for the solution!
April 20th, 2006 at 3:28 pm
Hello … today, I got an error message that I had not gotten since I started using it. Before today it had worked fine but today I get this error when I click on the category link -
The other odd thing is that it works fine if I click on a letter (which are still displayed on the page below the error).
Any help would be appreciated.
April 25th, 2006 at 5:19 am
Sorry about posting too fast … but I figured out what broke the script. The last post that I had entered was started with ‘The Grove’ and evidently the quote breaks the script because it does not know how to handle it.
Just wanted to let you know, cheers!
April 25th, 2006 at 5:23 am
Hey Nate, AWESOME plugin. I’ve been tweeking with it this morning but I have one issue I can’t seem to resolve myself. I checked the box “Show Post Title and Excerpt” but only the post title shows up. Am I missing something?
Thanks
May 8th, 2006 at 7:25 am
Thad — Thank you for the heads up. I’m not sure what the best way to handle this is. Any suggestions?
Rhine — WP-SNAP doesn’t automagically create excerpts like WordPress does. It actually pulls the excerpt from the excerpt post field. So, if you didn’t write an excerpt, nothing shows up. I’m not sure that this is the best way to go about this, because I’m sure many people make use of the auto excerpts WordPress creates. I’m sure it’s a fairly easy fix, let me think about it.
May 8th, 2006 at 8:07 am
WP-SNAP! has been updated to version 0.3. The plugin now creates a post excerpt from the post content if the post’s excerpt field is blank.
May 8th, 2006 at 9:55 am
Nateo - Thank you for creating such a useful plugin. I am using it to create a glossary on a Page. However, 1) when I add a new entry, it bumps the previous entry off the Page (so that there is only one), and 2) clicking on the alphabet menu brings me to the category page. Any suggestions?
shantarohse.com/glossary/
May 13th, 2006 at 3:13 am
Shanta — Beautiful site! I have updated the plugin to version 0.3.1, fixing the error with the urls linked to the navigational menu. I’m afraid that I cannot reproduce the error you are having with new entries bumping old ones off the Page. There’s no reason that I can see for all the entries under a give letter to not be displayed. Looking at your site, there appears to only be one entry per letter so far — are there actually more that cannot be seen?
May 13th, 2006 at 10:51 am
Nathan - Thanks for the quick response. v0.3.1 does the trick! The dropped posts is no longer a problem either - I think it was an artefact of the urls linking to the category page. It just looked like they were dropped. Great stuff. Thanks for the complement about the site - lots of the credit has to go to the Musil theme created by Florian Kriener.
May I ask - is it possible to add the more tag to the excerpts?
May 13th, 2006 at 6:56 pm
Shanta — You are welcome. If when you say “more tag” you mean that at the end of the excerpt it would say “[More]” or “[Read More]” etc. then, yes, that is possible. Aesthetically, that seems to be a little overkill for me since the title itself is a link to the full article, but let me tell you how you can “hack” the plugin to get what you want. Open up the plugin and change line 350 from:
To:
Obviously, you can change the word “[More]” to say whatever you wish.
May 14th, 2006 at 10:17 am
[...] nateomedia A recently released, and newly updated plugin that allows for the navigation of a category alphabetically. Which means the inclusion of a glossary, or the listing of reviews, people, etc can easily be done with WP. [...]
May 14th, 2006 at 3:36 pm
Thanks once again Nathan. And you are quite right about the aesthetics the more link. But it was nice to be able to try it out!
May 14th, 2006 at 8:02 pm
[...] Two WordPress plugins, Nathan Olsen’s WP-SNAP! and Joel Bennett’s Ubernyms work together to create an interactive glossary for your site. [...]
May 20th, 2006 at 8:39 pm
Hi,
I have saved wp-snap plugin. But at first attempt, it generated and rendered my dashboard as non-working. I could not even logged out. I had to then click back on the browser and de-activated plugin. Only then, I was able to logout of do other things.
I had then checked wp-snap.php and found a line space before the closing tag. And after saving, when I activated wp-snap, some of my existing pluging say for e.g. SK2, Akismet etc. were de-activated.
And after that, I created a category “Glossary” and page template, inside the template, I entered . “165″ being cartegory ID.
But I am receiving an error while viewing the page
Can you please look at and advice me to get this working.
DG…
May 21st, 2006 at 6:46 am
Hi DG — I’m sorry to hear that you’re having difficultly getting the plugin to work. I suggest that you re-download the plugin by right-clicking on the link above and then renaming the file as my instructions advise. Copying and pasting the code into a new document is really not a good idea.
May 21st, 2006 at 9:12 am
May I suggest that you provide a direct link to the mere simple PHP text file. It is rather painful to cleanup the phps file to use it.
With Opera, I finally got to produce a text file but with a bunch of additional CR-LF which break the comments into syntax errors.
It seems it will be what I need, but it will take some time before I can even try it.
Yves
May 21st, 2006 at 9:18 am
Hi Yves — If you right-click on the document, save it to your desktop, then simply rename the file, you should not have to clean anything up. I like providing the file as a phps because it allows those that want to look at the code before they download the plugin to do so. But, perhaps you’re right. Maybe I should provide a zipped version of the file as well. Making the change now. Thanks for your input.
May 21st, 2006 at 9:32 am
Hi Nateo,
First thanks for your reply. I just downloaded plugin zip file. And re-uploaded and activated again.
But when I go to page view, I am still receiving the followin quoted error:
Just to make the things easier for you, I have inserted this code in page template .
Here is the page link: http://www.roks.xmgfree.com/blog/glossary/
You can see what error is displayed, please advice me, I want to see it up.
Regards, DG…
May 21st, 2006 at 11:23 am
DG — Is this a category or a page? If it is a category, you do not need to input a category number (ie, 165), it will pull content from that category automatically. Do you have any posts in this category yet? If you do not, the plugin will not work right.
May 21st, 2006 at 11:35 am
Nateo - Please ignore my last post.
After activating wp-span plugin, I did the following.
1. Created a new category called “Glossary” with ID 165.
2. Created new template “Glossary-t” and inside this, I have entered the code as mentioned above in useage for e.g. .
3. Then I created a new page using the template mentioned at step 2. and named it “glossary”.
So, the link : http://www.roks.xmgfree.com/blog/glossary/
is of a page Glossary.
DG…
May 21st, 2006 at 12:42 pm
DG — Do you have any posts in category 165 yet? If you do not, the plugin will not work correctly.
May 22nd, 2006 at 10:18 am
Great Plug in Nateo, took me a minute to clue into how to install it…
May 30th, 2006 at 11:04 am
Tom — Thanks for the feedback. As you can see, your last comment got caught in the gap between the switchover from my old host to my new host. I was about to respond to it when you posted — it sounds like you figured out how to get the plugin to work? Glad to hear it!
May 30th, 2006 at 11:13 am
I did, it works great. I downloaded a visibility toggle plugin http://wordpress.org/support/topic/21171 as well so the new posts to the glossary don’t show in the categorys or at the top of the blog, rather they are a link.
here it is working on my page: http://www.digitalconversations.net/glossary/
One thing I noticed, although not really a big deal, but since I am pretty picky about the html, I think I may change the list tags to definition tags. If there is any difference as far as search engine optimization goes for this…which I will have to look into.
Great Plugin Nathan, thanks again.
May 30th, 2006 at 2:11 pm
i’ve just downloaded the “Latest Release,” but it identifies itself as v0.2, with the changelog last updated 03.2006.29. Did you neglect to update the versioning in the code, or is your link above a bit stale?
May 30th, 2006 at 7:56 pm
Tom — Let me know what you find out with regards to definition tags. If there is an SEO benefit, I’d be willing to look into making them an option in a future version of the plugin.
C — Funny thing, that. I was showing off my new site to someone today and noticed, to my horror, that very mistake. Unfortunately, there was nothing I could do until I got home. It’s all fixed now, however. Sorry for the confusion!
May 30th, 2006 at 8:12 pm
Thanks! One more heads-up… looks like you’ve recently changed your directory structure around. The Plugin URI in v0.3.1 is set to http://www.nateomedia.com/technology/wordpress-plugins/wp-snap, which 404’s, so clicking the link from one’s Admin Plugin page is no fun :(
May 30th, 2006 at 10:26 pm
Hi Nathan,
I tried to google this but haven’t found any information. I tried some define: keyword searches in google, and it doesn’t seem to favor one kind of syntax over another, although I can’t really make a conclusion as my experiment wasn’t exactly science based.
I made a post in an SEO forum. I’ll let you know if I find out anything else. I might make the change myself to my site just for accesibility purposes, and because I like the smell of a nicely marked up document. ;)
May 31st, 2006 at 1:56 pm
I’ve updated WP-SNAP! to version 0.4. Posts beginning with a non-alphanumeric character (i.e., a quotation mark, ampersand, percentage symbol, etc.) can now be incorporated into a category calling WP-SNAP! I’ve also streamlined a little bit of the code using regular expressions and updated all the links within the plugin to point to the new permalink.
June 1st, 2006 at 12:30 pm
Hello I have successfully installed your plugin but cannot get it to work. When I tried to put into my category-8.php it worked but the top would be all white and at the bottom there would have the your navigation system then below that posts in that category. If I could get it to know make a blank white page, and have the navigation shown at the the top it would be great.
I also tried the other way you described. By making a glossary page and then having the syntax in a basic page template. When I tried to view it would give me this different error :
Warning: Invalid argument supplied for foreach() in /var/www/users/luna6/lunapark6.com/wp-content/plugins/wp-snap.php on line 204
WordPress database error: [Got error 'brackets ([ ]) not balanced’ from regexp]
SELECT `post_title`, `post_content`, `post_excerpt`, `ID`, `post_password` FROM wp_posts, wp_post2cat WHERE left(`post_title`, 1) RLIKE ‘[]+’ AND `post_id` = `ID` AND `post_status` = ‘publish’ AND `category_id` = ‘’2′’ ORDER BY `post_title` ASC
any help or tips would be helpful!
June 2nd, 2006 at 7:40 pm
Oops sorry about the bad typing…basically when I added your recommended (echo wp_snap) command into the category-8.php file it would work but leave a huge white gap on the top of the page and would have to scroll down to see the your navigation system and first post.
The other way was pasting your command, specifying a specific category in a glossary page template…but when I tried to view it I got that big long error about brackets. thanks in advance for any tips. My website you can see in the error output.
June 2nd, 2006 at 7:52 pm
[...] WP-SNAP! WordPress Plugin Es el dia de los plugins novedosos. Este plugin permite hacer algo que hace tiempo andaba buscando, que es navegar alfabeticamente por los posts. Chori, no? (tags: wordpress plugin plugins navigation alphabetical alfabeto abc Browse) [...]
June 2nd, 2006 at 9:11 pm
Well I got rid of the error but with a blank glossary page the navigation system sits at the bottom of a white page. What kind of line can I use to make sit at the top the page?
June 2nd, 2006 at 9:35 pm
Ki — If I understand your problem, WP-SNAP is generating the menu correctly at this point, but a lot of white space is appearing above it? That sounds like a CSS issue. You probably need to alter your margins or padding around the menu using a div or class selector. I speak to this sort of issue in some of my comments above, unfortunately I don’t really have a lot of time to give a more thorough tutorial on the subject.
The error you received earlier was because WP-SNAP! was not finding any content in the category you called it from. I really should make the plugin fail more gracefully than that. My apologies.
June 3rd, 2006 at 10:21 am
Nathan no problem. Already appreciate the work you have done no the plugin. I am going to spend today looking at the CSS file and see if I can get it to show. Thanks for your input.
June 3rd, 2006 at 12:58 pm
Nathan one last question - is it possible to have your plugin ignore the word “The” ? A lot of films, books, music begin with that and would make it more balanced to ignore the first word it begins with “The”
June 3rd, 2006 at 2:05 pm
Ki — Is it possible? Yes. Is it simple enough so that I could walk you through how to hack it right now? No. Is it a good idea for a future update of the plugin? Yes.
I also would like to update the plugin to give the user the option to ignore titles beginning with a single or double quotation mark. When I sit down to work on the next version, that’s at the top of my list. Thanks for pointing out that “the” should be optionally ignored as well.
June 3rd, 2006 at 2:12 pm
Excellent. I was going to ask about ignoring “The” as well. I’m looking to use WP-SNAP to navigate cocktail recipes, many of which take an initial definite article by tradition. Of less use to me, but handy for others, would be ignoring A and An. Perhaps the best option would be to allow a user-configured ignore-list in the prefs, instead of hard-coding anything, since I’m sure every language and discipline has its own unique equivalent of Chicago Manual of Style guidelines on alphabetization.
Is there a parameter I could pass to wp_snap within a single.php page which would return the snap_nav, but no title listing? I’d like to be able to drill-down into a page like this one while still providing the alphabetical navigation strip. I suppose one could hide the titles via CSS, but it’d be messy, and consume extra bytes.
Thanks again for all your work on the plugin — it enables so many new uses for WordPress!
June 4th, 2006 at 2:19 am
Nathan,
I hope you can help me, as I would love to use your plugin. My site is bilingual and I am using Gengo 0.7 to manage my translated pages and posts. So, how could I use WP-SNAP! to generate a glossary for each language?
Currently, I am using
to generate my glossary list because (along with Gengo) it returns only the posts in the current language, while WP-SNAP! returns all the posts in all the languages. But as the glossary grows, I really need the neat pagination that WP-SNAP! provides.
Thank you.
June 6th, 2006 at 3:52 pm
Sorry, didn’t realise the form wouldn’t take the code. In the previous comment, I meant I am using $query_string .’orderby=title&order=asc’ in query_posts() to generate the alphabetical list of posts for my glossary.
Hope this makes sense?
June 6th, 2006 at 4:01 pm
Well, I did it. What I thought would be a quick addition turned into me re-arranging half the plugin. Presenting WP-SNAP! v0.5. One can now filter words from the alphbetization (I think I just made that word up) process by inputting them into a box on the admin page. Thanks Ki and C for the great input!
Indi — I don’t think what you’re looking for should be too difficult, but you’re going to have to do some footwork. I pull all the post_titles using a simple MySQL query. Looking at Gengo’s code, it looks like it creates a MySQL table to track the post translations. It shouldn’t be too difficult to hack the query in WP-SNAP! to only pull one set of translations based on the currently selected language. However, I don’t have the time to figure out how to do this. I suggest that you ask the creator of the Gengo plugin. Here’s the query I use:
If he can help you out with the query, I can tell you how to put it back in. Good luck!
June 6th, 2006 at 11:23 pm
Awesome, thanks Nate! On the QA front, it appears that the ignore array must be lowercase… at least, when I enter “A|An|The” as my ignore terms, all of my A entries disappear. Not a problem, however, when it’s lowercase, so I’ll be sticking to that :)
June 6th, 2006 at 11:56 pm
C — Good catch! I’ve reworked some of the code and I think I fixed the problem. Please let me know if you notice any more strange behavior.
By the way, with regards to your previous comment about being able to call the menu without listing the posts. I can do this. I don’t think it would be too hard. It’s probably going to be a couple of weeks before I can get to it though.
June 7th, 2006 at 1:39 am
Is there a version of ths plugin for wordpress mingus 1.2 version?
June 7th, 2006 at 4:45 am
Thanks for the plugin. I have been testing it and wondered if there could be a function added that would not ‘page’ the sections but instead just create an anchor that would take you down to the correct place on the page?
Also, is there a way to choose if I want:
A B C D ….
or
A-D E-G ….
by using a specific php call instead of from the admin menu? Sometimes I might want to use different formats within the same blog for different categories. Some have many many links, others have just many :)
Thanks in Advance, WP-Snap’s features are something I have been looking for since I moved from snip-snap as a Content Manager to WordPress.
June 7th, 2006 at 10:42 am
Sonali — I am not supporting WordPress 1.2. You can download the plugin and give it a try, but I can’t guarantee it will work.
GaryP — Neither is an unreasonable suggestion, but they are not features currently available in the plugin. I’ll add them to my list and see what I can do. Thanks for your input!
June 7th, 2006 at 11:09 am
Nathan,
I posted a request in Gengo’s support forum and one of the members very kindly wrote the new query for me. In fact, he modified WP-SNAP! v0.5.1 for Gengo, as per your suggestion. It works very well!
Thank you for your wonderful plugin.
Indi
:-)
PS: If anyone using Gengo needs this modification, then I can send it by email. Just contact me through my website.
June 7th, 2006 at 4:33 pm
Nathan,
Your plugin just keeps getting better and better. I would like to move my glossary from a Page to a post using Sören Weber’s Exec-PHP. Do you have any suggestions as to why this isn’t working?
By the way, if votes influence you at all, I’ll second Gary P’s suggestion about anchor links :)
June 16th, 2006 at 6:21 am
Indi — I’m glad things worked out for you. I grabbed a copy of the hack for Gengo as well. Unfortunately, it’s not something I can really build into the plugin (well, I could if there was the demand), but it’s an easy modification to make to the plugin should someone need to.
Shanta — Thank you for the kind words. I can’t think why it wouldn’t work, assuming that you’re calling a category when you call WP-SNAP! (e.g.,
). However, I never envisioned the plugin being used from within a post, so it could be that there’s some sort of MySQL problem going on there.
Okay, two votes for anchor links.
June 16th, 2006 at 8:57 am
Hey Nathan
This seems to be just what im looking for..
Im soo new at this thou…so i cant figure it out..
I downloaded the file, i Activate it in plugin…then you say something about
Add the following line on one of your category pages:
How do I do that ?
Sorry for my lack of knowledge.. :):)
June 17th, 2006 at 11:16 am
Jimmie —
If you look way back up through my comments to about April 20th, you’ll see that I mention how to alter your archives.php file to use WP-SNAP! Same idea for a category.php file. You make these changes in your theme files. In your case, this would be ./wp-content/themes/default/. Unfortunately, teaching php or html kind of goes beyond the scope of this page. There are lots of resources on the web devoted to this — good luck.
June 17th, 2006 at 12:15 pm
Hi Nathan,
thanks for this great plugin. I had to struggle a few to get it running. But now there it is:
http://web.consultants.at/websolutions/glossar/
So one hint from me to other users - and one question to you, Nathan.
First the hint:
If you don’t want to show each new post of the glossary on the frontpage, just edit the timestamp to a date before the blog has been started. Or select for your blog always the 1st of month or something like this. So I fixed this problem without wasting a lot of time by searching other plugins.
Now my question to you, Nathan:
Please have a look at the running glossary:
http://web.consultants.at/websolutions/glossar/
and now look at this one:
http://www.roks.xmgfree.com/blog/glossary/
how yan I make mine lok like this - depending the view of the single posts. I hope you know what my problem is.
Is this depending on the theme I use? Or can I change something to make it the way, that not all posts are displayed, but just the letter chosen?
thanks a lot for a hint
austrian greetings
ingrid
June 24th, 2006 at 8:58 am
Great plugin!
Can I exclude post in category (category used for creating glossary) from RSS feed?
June 25th, 2006 at 6:38 am
Love the plugin, but I have a suggestion. Could future versions have the option to simply have “#ABCDEFGHIJKLMNOPQRSTUVWXYZ” instead of “01234…ABC…”? Thanks!
June 25th, 2006 at 8:36 pm
Yeah, I was wondering about that, too. I’d like to clump all the movies that begin with numbers under a single “#” heading instead of having a separate heading for every number. Is there any way to make that possible?
June 25th, 2006 at 9:52 pm
I have the code on my archives.php file and I’m getting the following error on category pages. Any help?
Ken
Warning: natsort(): The argument should be an array in /home/chenchbr/public_html/quotes/wp-content/plugins/wp-snap.php on line 231
Warning: array_values(): The argument should be an array in /home/chenchbr/public_html/quotes/wp-content/plugins/wp-snap.php on line 232
Warning: Invalid argument supplied for foreach() in /home/chenchbr/public_html/quotes/wp-content/plugins/wp-snap.php on line 234
Warning: Invalid argument supplied for foreach() in /home/chenchbr/public_html/quotes/wp-content/plugins/wp-snap.php on line 272
Warning: array_values(): The argument should be an array in /home/chenchbr/public_html/quotes/wp-content/plugins/wp-snap.php on line 274
#
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
No articles found.
June 27th, 2006 at 8:41 am
Wow! Lots of questions. Sorry for taking so long to respond.
Ingrid — If you are only excluding one category from your main page (e.g., “glossary” with a cat id of “12″), you could also use query_posts(’cat=-12′); to remove those postings from your front page.
As to your second problem, open up the php category file you are using for your glossary and remove the WordPress loop from below of where you call WP-SNAP!
Lalex — RSS feed control in WordPress is pretty primitive. You could exclude a specific feed from being accessible through your .htaccess file, but it’s not currently possible to dictate what categories appear in your general feed.
Someone should write an RSS feed plugin.
Scott & lithium — I can do this. Thanks for the feedback. I’ve added this to my to-do list.
ken — WP-SNAP! does not work if there is no content in the category. This appears to be your problem.
June 27th, 2006 at 12:54 pm
Actually, I just realized I had left in an apostrophie. So yes, I guess category id (11′) did not exist. :-) Thanks!
Ken
June 27th, 2006 at 1:32 pm
Nathan,
Something weird. I’m getting posts listed that don’t belong in the selected list. Meaning, I select A-D on my site and I have posts that show with their titles starting with “G”, etc. The URL: http://www.chench.com/quotes/alphabetical-index-of-authors/
Ken
June 27th, 2006 at 5:45 pm
Thank you very much, Nathan!
Sounds simple. Weekend is coming soon and than I will try to fix this.
have a nice day and good luck to you
greetings
ingrid
June 28th, 2006 at 6:19 am
Ken — Checked your link. I don’t see the problem? Looks okay to me.
ingrid — Good luck!
June 30th, 2006 at 11:53 am
I still see it. It’s a quotes site and the quote author is used as the subject of the post. When I click on the “A-D” link I get a whole bunch of A-D plus Naploeon Bonatarte, George Carlin, Thomas Fuller, etc.
Is that not what you’re seeing? http://www.chench.com/quotes/alphabetical-index-of-authors/?snap=ABCD
June 30th, 2006 at 1:17 pm
Ken — Ack! You’re right. I have no idea what’s going on there. Unfortunately, I won’t have a chance to fix this for a few days. One question: If you change the menu type, does the problem persist? Okay, second question: Are you excluding any words? If so, can you copy and paste them as you entered them?
June 30th, 2006 at 6:09 pm
The problem does persist when changing the menu type. It’s now A-Z. I had no exclusions and just added “the” for fun but same result. I’ve been comparing the stray listings and there’s nothing different about them than there is with the proper listings.
Don’t worry about the delay. I appreciate you looking into it when you can. Enjoy the few days.
Ken
July 1st, 2006 at 3:38 am
Hey,
Great plugin…I was wondering if it would be possible to add a feature in your next release. Something like a checkbox for the user to list postings in either all the categories or each individual category only. Something like the google search function through adsense …theres a box to select search google or search your site. Perhaps allow the webmaster to pick which categories would be available for users to pick from? Thanks…
July 1st, 2006 at 6:27 pm
[...] WP-SNAP! Plugin Alphabetische Navigation! [...]
July 2nd, 2006 at 4:14 am
Hello, iam a german, so sorry for bad english.
I install your plugin and it works, but one problem. It dosn’t look like I want.
It looks:
1.A
2.B
3.C
…
and I want see it like:
#-A-B-C-D-E-F-G-H-I-J-K-L…..
I use the kubrick theme and paste your css in the style.css. This css:
ol.snap_nav {
display: inline;
float: left;
clear: both;
list-style: none;
}
ol.snap_nav li {
display: block;
float: left;
padding: 0 2px 10px 0;
}
ol.snap_nav li a {
font-weight: bold
}
ol.snap_nav li.snap_selected a {
cursor: text;
}
ol.snap_titles {
clear: both;
display: block;
border: 0;
list-style: none;
}
when i choose in the options the style i want nothings happen.
Can you help me? I hope you understand what i want.
July 2nd, 2006 at 1:07 pm
This is great. Is there a way to use this plugin to show all posts for all categories? I’d like to use it as a general TOC for the overall site. I’ve tried passing ‘0′ and nothing for categories, but it seems to just take the category of the page I am putting the calling PHP code on.
Thanks!
July 5th, 2006 at 4:46 pm
THANK YOU!!!!!!!!!!!!!!!!!!
Fantastic plugin. I’ve just put it on my local development site and set-up a few items, it looks like it’ll work brilliantly for me. Thank you!
A couple things:
1- Count me as another vote for anchors ;)
2- Would it be possible to do something about URLs? The format of ‘?snap=A’ seems to veer away from the pretty url available through WP. I’m not sure what the best approach would be, not even sure the plugin itself can handle it, but if it’s possible, maybe skip the question mark in the url? seems it would be easier on the human eye.
July 8th, 2006 at 6:25 am
Hi before I activate your Plugin I have written two posts,
aktivate wp-snap-wonderful:-)
write one more post, but wp-snap don’t show this post.
I’m using wp 2.03 on my testblog
regards
Monika
July 9th, 2006 at 8:58 am
Hi! I just wanted to drop by and say thank you for making this plugin. We are using it at NoticIEEEro, our blog and news centre for IEEE Region 9, Latin America and the Caribbean.
July 10th, 2006 at 11:40 am
To Everyone —
I’m sorry I haven’t been more actively responding to comments the past few weeks, but someone very close to me passed away last week after a long illness and caring for them had pretty much been to focus of all of my free time. I’m still sorting a lot of things out, but hopefully I’ll find a free day soon to sit down and review the potential bugs that have been brought to my attention, respond to comments, and perhaps introduce a new feature or two. Thanks for your understanding.
July 10th, 2006 at 12:50 pm
Nathan, no apologies are necessary. I’m so sorry for your loss.
Take your time. We’re not going anywhere.
Ken
July 13th, 2006 at 3:44 am
Hi, Nathan. First of all, sorry for your loss. Hope you are fine now.
In other order of things, I have a doubt about the usage of the plugin. In our glossary we need to sort words in Spanish starting with tilded letters, like “Ãreas”. This kind of words are placed in the “#” page. Is there any way to handle this?
Again, thank you.
Bests,
Pablo
July 13th, 2006 at 6:22 pm
Hi, like Roberlan, I don’t have any category.php file in my theme (3k2): should I copy the ‘default’ category.php page and put it in my theme? Or what else? Thank you, C.
July 14th, 2006 at 2:08 am
Hi. Iam back. :-)
I use the “pool” theme and don’t know where to input the php code. I have no categore.php page. please help me.
July 22nd, 2006 at 1:47 am
Is it possible to show defenitions on a separate page using this plugins? What I have is actually a short article, so it should be on a different page. Thanks! Nice plugin!
July 23rd, 2006 at 4:26 am
Nathan,
I have two questions.
1. I have an “index.php” a “categories.php” and an “archive.php” in use on my site. When the “index.php” and “archive.php” is loaded the plugin only registers half of the titles. When the “categories.php” is loaded all the titles are available. Is there a bug here or is there something I have to do to make the plugin work correctly on the other pages?
2. Is there a way to not have the plugin list titles on first load? I only want the titles to list when the user has clicked on a letter. Currently when the page first loads it lists titles beginning with the letter “A”.
By the way, this is a very good plugin. Thanks for making it available.
July 28th, 2006 at 8:54 pm
Okay, I guess it’s time that I addressed all these comments!
Ken — Your bug report is at the top of my list. I still am not sure when I will have time to next sit down and work on this plugin, but it’s what I’m going to be looking at first.
Michael — What you’re asking for is certainly doable, but there’s a lot of work under the hood that would need to be done to get the plugin to that level. It’s been added to my list, but this may not be something I can get to anytime soon.
Sven — The question you asked is a CSS question. Not only have I suggested how to fix the problem you’re encountering on this very page, but I’ve also requested that users limit their requests for these sorts of tutorials. CSS is a whole other ball of wax, and I don’t really have time to teach that to you. My apologies and good luck!
Brian — Right now, there is no “all” option. Perhaps there should be. On the difficultly of implementation scale, I would have to give this one a big, fat “I don’t know.” But I think I can do this relatively easily.
Nic — 1. Another vote down for anchors it is! 2. I hear you. You’d like a “prettier” permalink structure. On the coding side of things, I know how to make this work — the way I’m doing things is convenient because I can easily grab the snap variable that way, but I know of another way to do the same thing. But what should I do on the permalink side? What should this look like? Suggestions?
Monika — I would guess that you saved but did not publish your new post. Or, that you put it in the wrong category.
Pablo — Thanks for the kind words. I checked out your site but I didn’t see WP-SNAP! in action. Where is it? Or did you have to pull it because of internationalization issues? You’re alphabetization problem concerns me — I would really like the plugin to handle every “A” letter the same, accent mark or not. I’m putting this near the top of the list.
Claudio & Sven — I’m sorry, but I don’t have time to research this right now. I can see for more beginner users that this plugin is going to need a help document that answers these kinds of questions. But that may very well require help from other users. Right now, should I get time to work on this plugin, I’m going to need to spend it working on the code.
Broadcaster — I’m not sure what you’re asking. If you want, you don’t have to show “definitions” at all. Just titles. When the title is clicked on, it should take you to the permalink for that post title.
Craig — 1. On the index and archive page there is no way for the plugin to know what category you want to display. I’m guessing that on the index page it’s probably grabbing category 0 and on the archive page … I dunno. But WP-SNAP! only knows what category it is if WordPress itself passes that variable to it — which pretty much just happens on the category page. Otherwise, you need to tell it what category to display. Or am I not understanding the bug you’re reporting? 2. Currently, no. But I can do this fairly easily I think. I’ll add it to the list.
Sheesh, this little plugin of mine is looking to grow way beyond what I originally envisioned! Thank you all for your kind words of praise and encouragement and suggestions. I really appreciate that there are people out there in the world that have found this plugin so useful. I promise to get back to work on WP-SNAP! soon. Thanks again for your understanding.
July 29th, 2006 at 11:56 pm
Nathan: Thank you for your answer. WP-SNAP! is being used in our glossary at NoticIEEEro. We didn’t officialy launched it, but it’s working at that URL.
July 30th, 2006 at 10:14 pm
Nathan,
Can the plugin be tweaked to alphabetize all the titles regardless of the category?
July 31st, 2006 at 1:14 pm
Pablo — Thanks for the link, I’ll check it out. Should be looking into the accent issue soon.
Craig — Yes, here’s the hack:
Open up the plugin in your favorite editor and change line 223 to:
That should do it!
August 1st, 2006 at 1:01 pm
Wow, I didn’t realize the plugin was in such bad shape! I think I squashed the sort issue — I accidently typed an “i” where I should have typed a “j”. Ugh. I also started toying around with accommodating accent marks, but I’m not done yet. I felt like I needed to get the sort fix out to you guys as soon as possible, so look for another release to finish up the accent mark issue.
Not quite sure how I’ll fix that one — the letter I know isn’t working right now is “Ê”, which gets interpreted as an “A” somehow. No doubt this effects other accented letters as well. Hrm.
I look forward to feedback. Let me know if you find any more bugs.
August 2nd, 2006 at 1:12 am
Nathan: The issue with accent marks looks like solved, but now when you first access the function, the title list is not filtered (as you can see here). Previously, when you first accessed the function, the list showed filtered by the first used initial.
August 2nd, 2006 at 8:36 am
Pablo — The issue with the accent marks may not be solved, but the remaining issues might not effect your use of the plugin. It looks like it may only be very specific letter/mark combinations that are still at issue. Let me know if you encounter any problems.
Also, I’ve updated WP-SNAP! to version 0.5.3 and have fixed the bug with the list not filtering when you first access the page. Let me know if you notice anything else. Thanks!
August 2nd, 2006 at 7:22 pm
Yeah Baby! It’s working great now. Thanks Nathan!
ken
August 9th, 2006 at 5:36 am
Hi Nathan!
Is there a way to show all the titles of the category by default, and only after clicking certain letter filtering them?
Also I’ve seen talks about anchor system here, do you have plans to implement it?
August 13th, 2006 at 3:43 am
Ken — Thanks for the feedback. I’m glad it’s working now!
Broadcaster — Both features on my to-do list. Both are near the top of the list. However, I cannot give an estimate as to when I will get to these features. Thanks for giving me your feedback, though. It helps to know what people want to see implemented next.
August 13th, 2006 at 1:30 pm
[...] Nathan Olsen for WP-Snap!. [...]
August 26th, 2006 at 2:35 pm
He Nathan! The plugin sounds amazing, but I cant seem to get it working the way I want to… I only want it to sort my get_archive(), and dont want the whole menu structure with letters as options… could you help me out a bit? Thanx!
August 28th, 2006 at 3:36 pm
Baster —
Um, my plugin is “the whole menu structure with letters as options.” If I were to take that away, there wouldn’t be much left. It sounds like you just need to learn how to write a mysql query to retrieve the data you need. The kind volunteers over at the Wordpress Support Forums should be able to help you out with that. Good luck.
August 28th, 2006 at 3:46 pm
Hey Nathan and All,
I would like to do the following - my items have the form of (example) - “HD DVD - media for high definition video”. An in that title, I’d like to have HD DVD as bold. And if i put bold tag into the title it therefore sorts it as if it starts from “
August 28th, 2006 at 11:52 pm
Broadcaster —
Go to the admin menu for WP-SNAP! in your Wordpress admin control panels (under “Options”) and add <b> to the section at the bottom titled, “Ignore During Alphabetizing.”