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 WordPress Admin > Plugins > WP-SNAP! Settings. The available settings allow you to make site-wide changes to things like the alphabet, the navigational structure, permalink structure. 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
- 08.2010.05 Version 0.9.4
- Rooted out a couple more bugs
- 08.2010.01 Version 0.9.3
- The bug hunt continues!
- 08.2010.01 Version 0.9.2
- Fixed more bugs
- 07.2010.31 Version 0.9.1
- Fixed several bugs with the database call
- 07.2010.30 Version 0.9
- Improved international character support
- Added warning if database is empty
- 02.2009.20 Version 0.8.6
- Fixed bug with posts beginning with misc. letters on sites not using fancy URLs
- Fixed bug with adminstrative menu
- 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
Hi Nathan!
Everything works fine except group posts.
I’d like to group all my posts beginning with a number in a single page.
In the Navigational Menu Options I’ve checked “#0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ” menu style and “Group Post Titles Beginning With a Number”.
In the menu, “#ABCD…” is displayed but when I choose # it shows me all my posts, not only the ones begginning with a number.
Any idea?
I work with WP 2.8 and PHP 5.2.8
Seb — Are you sure it shows you ALL posts, or just posts beginning with numbers and miscellaneous characters? Have you tried turning off all plugins? I do not know of any bug with WP-SNAP! that would cause this.
Oh I’ve just realized I was using version 0.8.5 of WP-SNAP! Upgrading to 0.8.6 fixed the problem.
Sorry for disturbing, and thank you for answering ;)
Seb
Hi Nathan,
I installed your plugin (version 0.8.6) and it’s been working great until recently… We’ve been adding in a bunch of posts and suddenly we are getting an error when we go to this page:
http://www.depression-treatment.mobi/directory/california/
The error is:
Fatal error: Maximum execution time of 30 seconds exceeded in /hsphere/local/home/cliffsid/depression-treatment.mobi/directory/wp-content/plugins/wp-snap/wp-snap.php on line 229
Line 229 in the wp-snap.php file is the “return hmtl…” :
function accents($str) {
$str = htmlentities($str);
$str = preg_replace(‘/&([a-zA-Z])(uml|acute|grave|circ|tilde);/’,'$1′,$str);
return html_entity_decode($str);
}
I don’t know if one of our posts has a funny/special char in it that is causing the problem… it’s possible, but I don’t know which post it would be (we have 1600 posts).
Is there an easy way to find out what the problem is and which post is causing it? I don’t know that it’s a bug necessarily, but if it’s not designed to deal with certain characters, then we should avoid those characters in a post (so we’d need to know which ones to avoid).
If there is anything you can do or look at or help with I appreciate it.
Christa
Christa — The part of the plugin’s code that you quote is meant to strip out characters that cannot be sorted. My guess is that you are copying and pasting information into your WordPress blog from some sort of rich text editor. Make sure that you are sanitizing all of your text before adding it to your site. This is not a plugin issue, but an html/web server issue. Good luck.
By default, WP displays the 10 recent posts when using the following line;
php if (function_exists(‘wp_snap’)) { echo wp_snap(‘cat=3&firstload=RECENT’);
How do I change the default posts to, lets say, 20? I tried adding &showposts=20, as well as editing the “Define defaults” options in wp-snap.php but i couldn’t get it to work. Any ideas?
lightamatch — You change the number of posts by using query_posts(). Just make sure you call it after you call wp_snap().
Cool plugin, but I need to find a way to add three Norwegian characters. Out alphabet has three more letters, ÆØÅ you see. What do I have to change to get that running. I’ve tried a few things, but so far no luck…
Can you help me out?
Thanks for that great plugin. It is exactly what I was looking for. Sadly we had a problem with our german umlauts. All words beginning with an umlaut where listed under A. I checked your code and found the function accents. This function should exactly do what I expected, but it didn’t work. After a few tests i found out that the problem is the call of htmlentities(). You did not specify the charset-parameter and so the default iso-8859-1 is used. We use utf-8, which is also wordpress default. I changed line 227 of your code to htmlentities($str, ENT_COMPAT, ‘UTF-8′) and now it works perfect. For a final solution the setting of the WP character encoding should be used, but for me this quick solution is enough.
Thanks again with greetings from Austria
Peter
Thanks, Peter! It’s been a while since I looked at the international character sorting issue, but I’ll look into your suggestion and see how it works. The method I worked on involved building my own sort function — the testers I’ve given it to say it works but I just never had the time to really shake it down and make sure it was release worthy.
I’ve always gotten the sense that there are more articles on the web about sorting international characters, but that they are written in languages that actually have to deal with that issue. It’s been very frustrating trying to solve the issue as an English speaker.
Hi Peter,
Thanks for the workaround, it also solved my problem with German Umlauts :)
Greetz from Vienna, Austria,
Stephi
This plugin is fantastic! But not work with Custom Post Types. =/
Displays the following errors:
Warning: natcasesort () expects parameter 1 to Be array, null Given in my directory) (\ wp-content \ plugins \ wp-snap \ wp-snap.php on line 358
Warning: array_values () expects parameter 1 to Be array, null Given in my directory) (\ wp-content \ plugins \ wp-snap \ wp-snap.php on line 359
Warning: Invalid argument supplied for foreach () in my directory) (\ wp-content \ plugins \ wp-snap \ wp-snap.php on line 361
I’m using WordPress 3.0 + EasyPHP to test the plugin.
Any idea how to fix this?
I do not know of any bugs with the functionality of the plugin. The most likely cause of your issue is user error. Does the category you are calling have content? Are there existing posts? If there is no content, the plugin will not function. Do you have any other plugins running? Have you tried disabling ALL plugins except for WP-SNAP? If you legitimately think you’ve found a bug, please post detailed steps as to how to reproduce it or I cannot help you.
Hi, i’m using this plugin and i have one problem with it, it shows the “abc links” and they are clickable but when i click one of them it opens a blank page, it goes to URL: mysite/letter/browse-R/ for example but it is empty.
Do you know how i can fix this?
Thanks in advance
Unfortunately, you have not given me enough information to troubleshoot your problem. Please read my response to the post directly above yours. Have you tried the steps I suggested? If you believe that you’ve found a bug, you need to provide me with step-by-step instructions as how to reproduce it, otherwise I cannot help you.
I love this plugin. Exactly what I was looking for.
I have one question though.
Firstload can be set to all (shows every post in the cat), none (shows no posts) or recent (shows ordered by date). Is there a way for first load to just show the number of posts set by wordpress query (10/16/20) with the pagenation but still be in Alpha order, like “recent” but alphabetical instead of by date? When I don’t set firstload the posts for just “A” are shown. I wasn’t sure if I was missing something.
Thanks for a great plugin.
Try calling query_posts with a posts_per_page limit after calling wp_snap with a firstload of “all”. It will limit the number of posts that appear under each letter as well, but you could use an if statement with $_SERVER['REQUEST_URI'] to detect if you are on a specific letter and use that to keep wp_query from running.
I love this plug-in. However, I’m having a problem with the cat argument. There’s a conflict with another plugin (TDO Mini Forms) I use so that users can create and edit content using a form. When I don’t specify cat, so that all posts are served, the page looks fine. When I set cat to a value, multiple permalinks to the edit page show up and, most disturbing of all, the entire set of forms shows up below the footer.
http://www.sfarwa.net/category-index/
I’d appreciate suggestions. I know there’s a collision going on someplace that I’ve done simple experiments in trying to resolve with no success.
Using the multi-color theme; created category.php from the default page.php. Tried using their native archive.php with no different effect.
I need to use the cat argument as I’m using the snap index on two separate sets of posts.
Unfortunately, I don’t have the time to troubleshoot that conflict. If you’re able to determine that the problem lies with WP-SNAP, I will look into resolving it.
Hi Nathan i have this plugin running in my site.
It was working nice til i changed my hosting.
Now it show a “No post matching your criteria” message.
I tried uninstalling and installing it again.
I dont know what else to do.
You can check it at http://www.escenariorock.com/directorio/artistas
I just released a new version of the plugin today and its possible that there is a bug. But there’s no way for me to help you unless you tell me step-by-step what you’ve done to produce this result. I can’t fix a problem that I can’t reproduce. What version of WordPress are you using? Did you try turning off all other plugins? Where did you call the plugin? Is there content on your site?
I just caught a couple of bugs with the new version of the plugin. I’ve patched it and uploaded the new file. Give that one a shot.
Works like a charm again (version 0.9.1 under WP3.0.1). There are still tiny issues though.
Posts starting with ‘the’ and excluded in the ignore list don’t show at all anymore. Not under T, not under their original letter.
“Group Post Titles Beginning With a Number Under Miscellaneous” doesn’t work. All numbers are shown separately.
The style of the navigation at the top has changed. Active letter are not selectable anymore which reflects the layout. This can be changed in the CSS of course so is no major issue but still changed from previous versions.
Thanks for the feedback, Leon. Unfortunately, I was not able to duplicate an errors with the ignore list — it seems to be working fine. If you continue to experience that problem please provide me with instructions as to how to duplicate it and I will look into it further.
I was, however, able to fix the “Group Post” issue.
As to the issue about the navigation changing, that too was a bug fix. The behavior you are used to only occurred with navigational menu style #2 and #3 — menu style #1 never worked that way. Sorry for the CSS issues the fix raises.
Right, thanks for the update (still referred to as 0.9.1 on this page, you download 0.9.2)
The grouping works again. But the ignore list still doesn’t. This page doesn’t show up in this index (it did before). All entries from the exclusion list work ok, except the word ‘the’. Leaving the word ‘the’ from the exclusion list, make the posts show up under ‘T’.
Yes, I’m not doing much to keep this page up to date at the moment. This last plugin update took about three days — I’ll be happy if we can just get all the bugs worked out of the code.
So you’re saying that your ignore list works for everything except the word “the”? The ignore code was rewritten — maybe the problem is with how your ignore list is set-up? Try deleting your list, saving your settings, and then retyping in your list (items in the list should now be separated with a space instead of a pipe). If that doesn’t work, post again and I’ll email you about running some tests and figuring this out. Thanks!
I deleted the list, created a new one.
I reinstalled the plugin.
I renamed some of my posts.
Still the same result. It must be the exclusion list. I changed the title of a post to start with xx and added xx to the exclusion list and still no go. Seems like only a and an are processed…? Adding other excluded keywords to posts remove them from the index completely.
Thanks for letting me know. You are correct, there was a bug. I’ve corrected the code and released a new version. 3rd time is the charm, maybe? :)
And a charm it is :-) Thanks for the great work and support!
There is an error
Warning: preg_match() [function.preg-match]: Compilation failed: missing terminating ] for character class at offset 4 in /vrmd/homepages/u43800/blog/wp-content/plugins/wp-snap/wp-snap.php on line 395
i can not find the reason..
I have released a new version of the plugin that may address the errors you encountered. If you still are encountering problems, I need you to give me step-by-step instructions as to how I might reproduce them. Thanks.
I’m experiencing the exact same issue as Simona (I recently upgraded to v0.9.4 – I don’t recall this problem being present previously, but can’t swear to it). This error does not appear on every page, just the default glossary page that shows the alphabet (ie: the error does not appear on a page generated by clicking on a letter of the alphabet, just on the main glossary page). The error appears the same number of times as the number defined in the WP-SNAP setting “Display n recent posts”. Take a look at my glossary page, http://www.dooneyscafe.com/archives/category/dictionary, for an example.
Great plugin, and your support for it is appreciated!
Thanks,
HB
Just to follow-up here, I have heard from two people that there appears to be a problem with listing recent posts under certain circumstances. Unfortunately, I have not been able to pin-point what those circumstances are. I have not been able to reproduce the bug.
If anyone else is experiencing this problem, please post here and I will contact you via email about it. Hopefully we can get this resolved.
Thanks!
Does this plugin support pages yet? I would love to use this as an index for my review page which will have a large number of sub-pages underneath it. Anyway this plugin can support that?
Yeah, it can probably be done. I don’t really have the time to figure it out right now though. I’ll see what I can do.
Thank you so much for the consideration.
Hey Nathan,
I know you said time was limited, but this plugin is the only thing holding up a major site build I would like to complete this month. Anyway you can consider adding this functionality sometime soon?
Now that would be really awesome!
This plugin is a lifesaver! Haven’t had any problems with it at all! Thank you so much for putting it together!
Hi, Nathan!
Some time ago I have problems to display Custom Post Type with the WP-SNAP. I really don’t figured out the problem and decided not to use the Custom Types Post … then the plugin worked well.
But I finally know how to list different plugin Post Types. I changed the following line in the file wp-snap.php:
$ WHERE .= "AND (post_type = 'post' AND (post_status = 'publish'";to
$ WHERE .= "AND (post_type = 'movies' AND (post_status = 'publish'";But how can I insert multiple Post Types, including the standard “post”? And how to show different Post Types in different custom templates?
Only need it for the WP-Snap works well with this role of WP 3.0.
Thanks! =D
Davi — Unfortunately, I do not have the time to support custom modifications of the plugin. However, it does occur to me that your problem with custom post types might come from the fact that you are entering the post category name instead of the post category number.
That is, category ‘movies’ has a number associated with it that you can find by going to admin -> posts -> categories -> movies and looking at the url. You should see something like ‘&tag_ID=1′ where ’1′ is the category ID number.
Then call the plugin: if (function_exists(‘wp_snap’)) { echo wp_snap(‘cat=1′); }
I got custom post types working.
$where .= ” AND (post_type = ‘post’ AND (post_status = ‘publish’”;
Change that line to this “emulation” and “android” being the custom types I wanted the plugin to support.
$where .= ” AND (post_type = ‘nesgame’ OR post_type = ‘post’ OR post_type = ‘android’ OR post_type = ‘emulation’ AND (post_status = ‘publish’”;
Hi!
I’ve got this error “[function.preg-match” on website
http://recenzje.neogo.pl/kategoria/playstation-3/
I’m willing to help, to find it.
regards,
Tomek
Tomek — Unfortunately, there’s not much I can do on my end. If you can come up with a set of instructions for me to follow to reproduce the problem you are having, then I will gladly work to fix it. You need to figure out why the plugin is breaking. For instance, if you start with a clean install of WordPress (and one or two posts so there is some content for it to work on), does the plugin break for you? If you activate in the other plugins you use, is that when the conflict occurs? Or is the problem specific to a certain type of post? What type? What post?
Thanks for your help!
Hey man,
at first really nice work ;)
So i hab a little problem, so my lexicon hab about 80 entries and on ‘A’ 5 entries and at the bottom Page 1 of 3 123» , but i cant change the page, it also show the same entries. How can i change the number of entries it would to show ? The ‘Recent Posts – Display Recent Posts’ doesnt work for me.
Greeting from Germany
Pagination is not supported by the plugin. The number of recent posts to display won’t help you because these are not recent posts. You can either change the number of posts to display in your WordPress settings for the entire site under Settings > Reading, or call query_posts() after calling wp_snap() on the category page.
hej Nathan,
greetings from cold Germany and thank you very much for this plugin.
I wonder if it is possible that the found articles are just listed with their titles (or excerpt) and then have the “read more” link to open it in full?
I am sure that’s a silly question for an expert,but so far PHP is still wonderland for me…
best regards, Michael
Yes, it is possible. Edit your WordPress loop.
Wrong parameter count for strstr() in /var/www/top/html/wp-content/plugins/wp-snap/wp-snap.php on line 571
Warning: preg_match() [function.preg-match]: Unknown modifier ‘]’ in /var/www/top/html/wp-content/plugins/wp-snap/wp-snap.php on line 398
What can I do?
You need to upgrade to a more recent version of PHP. Or, change line 571 to:
return strstr($haystack, $needle);
I get this error:
Warning: preg_match() [function.preg-match]: Compilation failed: missing terminating ] for character class at offset 4 in /home/pcspecs/public_html/wp-content/plugins/wp-snap/wp-snap.php on line 398when I use the argument ‘firstload=recent’
You are not the first person to experience this problem. I have not been able to reproduce the issue, so I haven’t been able to figure out how to fix it. After solving Moscaliuc’s problem, it occurs to me that this too might be a server issue, although I still haven’t determined how to reproduce it. What version of PHP are you running?
Also, have you tried running WordPress with all your plugins disabled (except WP-SNAP)? Are you using a language other than English? The more info you can give, the closer we get to an answer. Thanks!
I get the same error :
Anybody have a solution ?
Yes, help me fix it. Tell me about your set-up. Do some testing to see if there is a plugin conflict or if the error only occurs with certain categories or posts. Tell me where you’re calling the plugin. Help me reproduce the error. It’s the only way it will get fixed.
Hi. This is a great plugin. Is it possible that instead of looking for Posts (and thie headlines) it can alphabetize Tags instead? In your documentation above, you note that it “displays posts/tags when it is first called on a template”. In effect, if it could do this, it would act as a glossary of post terms.
Well, what is meant by that is that in WordPress a category is the same thing as a tag. So you can list all the posts within a category or all the posts within a tag. But you can’t list categories or tags themselves.
Thanks for that great plugin. It is exactly what I was looking for.
But I have problem with accents like “é”.
How I can resolve this problem ?
Thanks again
Julien
What’s the problem? All alphabetical sorting is now done within MySQL, so assuming the server you’re running on understands your language, there should be no problem with accent marks. Titles should sort just as they would if called directly by WordPress. If the issue is that you want accented letters to show up in the alphabet, that can be controlled in the admin settings.
Hello. I have a problem. The menu=1 type not working properly: navigation hyperlinks is not clickable. On menu=2 type and menu=3 type is ok.
I have a WordPress 3.0.1 and I am working on MultiUser interface.
I haven’t tested the plugin with MU, but I don’t see why it should make a difference. Does this problem occur with a default (no plugins or themes) installation of MU? If not, it’s a conflict with something you’ve installed.
If you’ve tried that and it still doesn’t work, let me know and I’ll take a look as soon as I can.
You’re right. It’s a problem on my side. On default instalation on twentyten theme, everything’s allright. But I don’t unerstand why it’s not working on my wordpress. I havn’t got any plugins installed.
Hi Nathan,
just like Julien above, I have trouble with the « É ». Dealing with this is more complicated than you say.
When I do nothing special, my posts starting with « É » get sorted under the « # » menu item.
When I add the letter « É » to my alphabet in the admin page :
If I chose the first menu style and I click on the letter « É » on my glossary page, I get served one my posts starting with « E » (no accent). Why this specific post? I have no idea. And my posts starting with « É » are nowhere to be seen.
If I chose the second menu style, the menu item E-G looks fine, but when I click on it, it goes to a URL finishing with « /browse-EÉFG/ », resulting in a 404 error.
I am sure fixing this permanently would benefit a lot of people.
It’s difficult for me to support foreign languages because I only know english and test on servers that are localized for english. (I’m not proud of this — I’m a product of the American school system.) I’ll look into the problem a little more when I get a chance, but I tested accented characters and it worked okay for me.
Hi again, Nathan
I have another remark :
the way the plugin is built, there are two duplicate pages. The browse-ABCD (or whatever, depending on menu style) and the main category page are identical, which is not ideal for SEO.
Is there an easy way around this?
Link directly to the ABCD page instead of the category page? Or set the plugin to “firstload=none”?
Thanks for the plugin!
I couldn’t figure out how to integrate the alphabetized posts (http://codex.wordpress.org/Alphabetizing_Posts) so I gave this plugin a shot. Still not completely understanding the WP loop or where to integrate this plugin in my template’s category.php, I made a hook in my template custom_functions.php instead:
function custom_wp_snap() {
if (is_category('6'))
{
if (function_exists('wp_snap')) { echo wp_snap(); }
}
}
remove_action('thesis_hook_archive_info', 'thesis_default_archive_info');
add_action('thesis_hook_archive_info', 'custom_wp_snap');
Works like a charm now.
Thanks!
Thanks a lot for this plugin, this is very useful!
But actually I’m writing this, because I have a slight problem using it. All works fine except for one thing. When I load a single post by clicking on its title, my blog shows the first post in an alphabetical order (a click on the post ‘Foo’ results in displaying the post ‘Bar’).
I found out that the collection of posts to be displayed is changed within the method wp_snap_core->navigate(), i. e. after the following line of code.
$wp_query->posts = $all_posts;I’m glad that I found out, but I still don’t have any clue what to do about it. Do you have any ideas or suggestions?
Wrap your WP-Snap call with:
if (is_single() == FALSE) {
Is there a way to include the alphabet list on a single.php template, but without changing the query for the single post?
I want people to still be able to see the sorting options when on a single page.
Thanks for the plugin.
There may be an easier way than this, but this is what first comes to mind: Call WP-SNAP with “firstload” of none, then rewind the WordPress Loop and run it again for your post.
What do you mean “rewind” the loop?
Try Googling “WordPress rewind loop.”
I need to ignore when alphabetizing two words separated by space. For example “building at”. In previous versions I just added “building” and “at”. And it worked. Now only “building” ignored.
Sorry, but the way the plugin functions was rewritten. If “building” and “at” are added to the ignore list, “building at” should still be ignored. However, “building” and “at” alone will also be ignored.
I don’t know of an elegant fix for this. I’ll take a look at it again when I can.
Hi,
Nice plugin. I have a question though. I don’t understand the Fancy URL field on the settings page. I’m using custom permalinks but don’t know what i should write in the fancy URL name field. The actual name of the page displaying the plugin? The page i use is actually a category template so it doesn’t display a “pretty” permalink.
thanks
Whatever you write will show up in your url. That’s all it does.
Hi Nathan,
I’m actually working on a project of a movie database using your plugin, which is really nice, but I have some trouble using taxonomy with it (categories doesn’t fit to the structure to me). When i’m not using your plugin, my taxonomies pages are listing correctly the posts regarding of the link the user just clicked (i.e. if the user tries to display only comedies or only movies from an actor or a country) but when i put down your plugin on the page it simply display all the entries.
Could you please consider a ‘taxonomy’ argument in addition to the actual category one or give me some advices for it (I don’t think i’m good enough in php for make my own fork of your plugin but if there’s no other way …) ?
I’m sure that it may help other people to be able to filter the entries your plugin are listing with the relativly new wordpress taxonomy system. Excuse me for my english.
Regards.
Soyel — Thank you for the suggestion. I’ll consider it.
I absolutely cannot get this plugin to work with the navigation menu #1. It works with menu #2, but not with #1. I have disabled all my plugins except for this one – still doesn’t work. I am using WP v3.0.1 and the TwentyTen theme. I am using the following code in my Page.php
if (function_exists(‘wp_snap’)) { echo wp_snap(‘cat=all&child=true&firstload=recent&menu=1′); }
My main glossary page is a static page, which I am making my home page. The glossary terms are added as posts. The plugin works fine when I have Menu #2 selected…but I want Menu #1…and when I do that, ALL the navigation links are disabled, so I can’t browse using letters of the alphabet.
Am I the only one with this issue??
Ash — I haven’t heard of anyone else having this issue. Thank you for the specific information regarding your testing. I’ll take a look at it and see if I can reproduce the issue.
Nathan. I’ve upgraded to the new version, using Wp 3.03. All is well except that I am using WP-Snap as a directory of people, and I was using the old hack from Daniel Quinn to reverse the names, but it does not work in the new version of WP Snap. Have you included this into the current version? Can you suggest any way to achieve the same effect? many thanks. Kurt
I haven’t incorporated any Daniel’s ideas into the plugin yet. You might consider using an older version of the plugin — I would suggest 0.8.6. You can find it here: http://wordpress.org/extend/plugins/wp-snap/download/
Thanks for your reply. I actually made a small work-around that turned out better than expected. Maybe this will benefit other users. For the Title I wrote the name (Last name, First name). This satisfied the alphabetical listing. Then for the display of (the_title) in the post and on the letter page, I instead put the name as I want it displayed as a custom field and called (the_meta) instead of (the_title). Many thanks.
Thanks for the plug-in. On the site I’m currently developing I wanted to be able to drill-down into individual glossary entries AND retain the list of letters at the top of the page. (Among other things, I only ever wanted people to comment on a single post at a time.) This seemed to be much harder than it looked, but I eventually solved it by dropping in this kludgy code right above the “no query is found in the url, select first post title letter” section.
// JGL: Skip the letter selection if first_letters is NULL
// AND the incoming URL is not the root URL.
if ($this->first_letters == NULL && $_SERVER['REQUEST_URI'] != $myRelPath) {
$requestedpost = str_replace(“/filetransfer_glossary/”,”",$_SERVER['REQUEST_URI']);
$requestedpost = str_replace(“/”,”",$requestedpost);
echo ““;
for ($i=0; $i ID);
$thispostlink = str_replace($myBaseURL,”",$thispostlink);
$thispostlink = str_replace(“/”,”",$thispostlink);
if ($thispostlink == $requestedpost) {
// Do nothing – the post is already included in the set
} else {
$all_posts[$i] = NULL;
}
} else {
// If no query is found in the url, select first post title letter
…
}
There’s probably a dozen better ways to do this, but it’s late and I got it working.
Hey there. :) Just as a heads up, in the latest version (0.9.4) the weird bug when using it with query_posts is back, totally messes up the loop. I downgraded to 0.8.6 and it works perfectly again.
This plugin is great, this is the second time I’ve used it for a client’s site and they are always thrilled. Thanks!
I got the query_posts thing with both 0.8.6 and 0.9.4. Dunno what’s going on there. I’ll work on it — thanks.
hello
Here is the error code on my web page:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 35 bytes) in /vhosts/c/y/cyberstr/www/wp-content/plugins/wp-snap/wp-snap.php on line 404this should not be an plugin error but the host.
I don’t know what to tell you on this one. All the plugin is doing is pulling and sorting the posts you requested. Clearly, you have a lot of posts. Sorry.
Plugin works great for categories, but could it also be possible to make it work for custom post types?
Nathan,
Great plugin! Very helpful with what we are trying to accomplish. I have the plugin installed in my header.php file so it will work globally throughout the site. Is there a way to get the plug-in to show all posts on load?
Thanks!
-Dan
wp_snap(‘firstload=all’)
just wondering if there’s a way to make this work with wp_list_category() or something on the level of paginating a list of categories instead of post