Custom Query String Reloaded for Wordpress 2.3 with tag support
Thanks for visiting! If you're new here, you may want to subscribe to my RSS feed. My blog posts useful tips, ideas, tutorials and guides for WordPress bloggers - and articles about the life on the Canadian Prairies. If you are familiar with RSS readers, just add my feeds to your reader! You can also receive updates by email if you submit your email address in the box on the far right sidebar.
Also, if you are here searching for WP Tutorials, please download the Best 7 WP Tutorials in this ebook.
Since I was anyway working with the Custom Query String (CQS) plugin earlier, I decided to take a look at the so-called UTW version of it made by Andy Beard. The addition he made introduced a new option: to define how many posts are displayed on a tag archive page - if the Ultimate Tag Warrior plugin was installed and the posts were tagged.
That CQS plugin stopped working with WordPress 2.3 where the the whole category system has been reworked. The UTW plugin also became obsolete since in this version the developers introduced WP’s own tagging system.
I messed around a bit with the code and finally came up with a version that is using the new tagging system of WordPress to define how many posts to be displayed on a ‘tag archive page’.
You can set the number of posts for a lot of different “views” (archives, month, categories, categories by name, home, search etc.). For the options that you will not set your custom number of posts - the number set in the Options > Reading will be inherited.
The plugin has been tested with the Default and the Classic theme on WP 2.3 and 2.3.1 installations.
Download and enjoy!
P.S. Please, report back, comment below if you notice any bug or experience difficulties with the plugin. Although I am not a pro coder I will try to offer limited support.
UPDATE for WordPress 3.1.1.
Seemingly, this security upgrade has a small bug (according to the devs), which makes several plugins to stop working. Or, in our case the plugin can mess with certain core feature - like the Media Library.
As reported by Belinda if you have issues with the plugin, try to download the Hotfix plugin, which addresses the WP bug until the next upgrade…









excellent post thanks i needed something like that
I have a problem,
When you select is_home, 1 days, DATE Desc - It is not showing all the posts from the most recent day like it did before. I would appreciate some help on this if you can.
Hei!
Great jobb, but i think with a bug. In my blog, i like to order on category asc. but i doesnt work with a selected category. Is it a local problem or not?
Thanks! Markus
Hi Markus,
I just tried on a test install (again) and both setting ALL the categories (is_category) or just on one selected category to have ASC - it worked.
This is really a useful plug-in. I’ve been browsing wordpress support forum for more than a week now trying to find solution for my problem (categories and archive do not appear)..
Thanks, I found this..
Thanks for this - this is an excellent plugin and I’m glad somebody picked it up.
i was looking for this solution for a long time! the plugin is pretty cool! thx
Hi just downloaded this to my practice site and all is going well. Thanks for the plug-in I had being trying to resolve this problem all day. This plug-in is the answer
Mark
Hi Mark,
I am glad you found it useful. Actually, all the credits should go to the original author - I just updated it to work with the newer WP versions.
Fabulous job, Moshu. Works like a charm! :)
Thanks, Nicki, glad you like it!
awesome work. is this compatible with wordpress 2.5.1?
gracias!
Just updated the Download page with a note that it works up till WP 2.5.1.
It doesn’t seem to work for me in Subcategories. It works in the Parentcategory though.
There is one Category “Events” (parent) and two subcategories “shows” and “parties”.
In the “Events” Category it works, but not in the “Shows” and “Parties”
Any Ideas how i can fix that?
Thanks in Advance :)
It appears that transycan.net has disappeared. Is there an alternate way to get this plugin?
Dreama, yes.
Here. On the Download page.
I’m also having no luck with subcategories on WP 2.5.1. The plugin seems not to work on any of them—it’s as if it’s not installed when I view my subcategories.
I love this plugin - thank you so much!
Thank you! I just installed this plugin on two sites and tested it with category archives, month archives, day archives, and specific categories. It works great… was exactly the kind of thing I was looking for to control how many posts appeared under certain conditions.
Both sites are at WP 2.6, so at least those functions I’ve tried work fine at that version.
This just ended a couple of frustrating hours with CQS 2.7 and a WordPress 2.6 installation and errors I was getting on category pages.
Custom Query String Reloaded fixed it!
Also thanks to http://www.dailyblogtips.com/ who shared this plugin location.
Thanks for the hard work and plugin.
hi — how do i show all posts in a category archive page?
query: is_category
show: ___ posts ??
“-1″ seems to have done the trick… thank you!
I love the CQS plugin! Recently I’ve noticed that the paged setting loses several pages of posts. For example home page is posts Aug 10 - July 21, the paged posts (page 2 as set through CQS) displays May 1 - April 1 instead of the chronologically ordered page containing what ought to be page 2 .. if that makes sense.
I’ve heard that other people have had this issue, but can’t find a fix.
Is there something I can do?
Thx!
What is the setting for the “home” page? FYI the day/date based settings doesn’t work in WP for ages!
Thanks for this efficient&helpful plugin !
Thanks sooooo much, spent a lot of time trying how to code this in - all i needed was this! Great work.
@ Moshu:
My WP front page is set to 5, the CQS is set to display -1 categories, -1 monthly archives both work perfectly. However when I set paged to display 15 I lose a page of posts, skipping from the current month to about May. I don’t use date settings at all.
Excellent plugin! So far I’ve been using the query_posts() function, but unfortunately it breaks my page/2/, page/3/ and such.
Your plugin is perfect and working! Thank you for sharing :)
Hi,
I love your plugin. It is exactly what I was looking for. But I have what I think is a bizarre problem.
It is working great on all the Categories I have it set on. But on the archives it works great on July and September but is not working at all on August. I can’t figure out why it would work fine on two months and not on the third.
Hope you can help me. Thanks, Hedon
Hi,
Just wanted to say that I tried it again today and it worked for all three months. This is really a great plug-in. Thanks again.
I am glad it worked for you as you expected.
Exellent, big thanks.
Thank you, works like a charm.
Thanks this is exactly what I was looking for
I have tried the plugin but with no luck maybe its my layout?
Does WP-Page Navi adjust the navigation buttons according to the amount of posts from custom query string plug-in. As i have different amounts of posts for some categories.
Thanks
Harro,
Try it without the other plugin. Does it work? If yes, there might be some incompatibility between the 2 plugins…
Hi,
I have been searching for this plug in for so long but it will not work,
I am using WP 2.6.3,
Please help
Kaya
“will not work” is not the best technical description…
What exactly doesn’t work? It works for others, so most likely you are doing something wrong.
Hi Moshu,
I installed and activated the plugin and made the changes which I want the dates in ascending order
But nothing happens. Check this page http://panicattackrx.com/information/panic_attack_causes/
Thanks
Kaya
This plugin works, and doesn’t work.
It works on the is_catgory, but not the cat_48 specific. What I am trying to say is it doesn’t work when setting the showposts for specific categories. I am on WP 2.6.3
Is there any documentation?
Am I missing something?
I’m willing to do some work if someone can help me.
No, there isn’t any specific documentation, as far as I know.
Any chance that the categories in case are sub-categories? There might be some issues with the subcats and I didn’t really have time to look into it.
I was hesitant at first coz the older version crashed my site. After some more reading, I was convinced to try and…. voila! Worked like a charm in Wordpress 2.6.3
Thank you very much!
Is there a page token that will query the most recent post and pull it into a page?
There, probably is, although that wouldn’t have anything to do with this plugin.
Hi, does this plugin work with Wordpress 2.7 ?
I needed to show one post on my front page and more than one post on the category page. This plugin worked perfectly! Thank you soo much!!!
Hi.
I’ve been looking for a way to display all posts added to a category on a certain date on one page when clicking on the category link. Clicking the “previous” link would link to a page displaying all posts added the day before and so on. One of the moderators at wordpress.org told me that this plugin would do the trick and it did sound great, but somehow it doesn’t work.
I added the condition
“is_category Show 1 days per page, ordered by date DESC”
but Wordpress only displays just one post per page. The maximum number of posts to be displayed is set to 15 in the admin panel, so that shouldn’t be the problem.
Any idea, why it doesn’t work? Maybe I got it all wrong and the plugin isn’t what I’d been looking for, but somehow it sounds like it should.
Thanks in advance for any help.
The problem is that the “show X days” is a remnant from the days when this was a valid option in WP… many, many versions ago.
There is no more such option in WP anymore, which means this will not work even when using the plugin. Sorry.
Too bad.
Thanks for the reply anyway.
Hi Moshu
Does this plugin work with Wordpress 2.7 ?
I’m actually trying to install it, but this message appear when I activate the plugin :
“the extension file does not exist”
Tank you for your help Moshu !
Yes, it does work with 2.7.
The error message isn’t related to the plugin or WordPress. It sounds more as a microsoft error…
Thanks for your quick answer Moshu
I try differents ways to avoid this “bug” (which is not apparently), and finally install your plugin manually
…It seems to work now :)
Thanks for your works and your kindful help !
FYI, here is what I get instead of the download. Sorry, I really needed it. Thanks.
Warning: opendir() [function.opendir]: open_basedir restriction in effect. File(/home/www/moshublog.com/download) is not within the allowed path(s): (/home/mblog:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/mblog/public_html/wp-content/plugins/download-mgr.php on line 377
Warning: opendir(/home/www/moshublog.com/download) [function.opendir]: failed to open dir: Operation not permitted in /home/mblog/public_html/wp-content/plugins/download-mgr.php on line 377
Warning: closedir(): supplied argument is not a valid Directory resource in /home/mblog/public_html/wp-content/plugins/download-mgr.php on line 388
Warning: Cannot modify header information - headers already sent by (output started at /home/mblog/public_html/wp-content/plugins/download-mgr.php:377) in /home/mblog/public_html/wp-content/plugins/download-mgr.php on line 418
Warning: Cannot modify header information - headers already sent by (output started at /home/mblog/public_html/wp-content/plugins/download-mgr.php:377) in /home/mblog/public_html/wp-content/plugins/what-would-seth-godin-do/what_would_seth_godin_do.php on line 123
Sorry, Mark!
We are in the middle of moving all our sites to a new server and a lot of fine tuning is still ahead.
I have changed the links on the download page, so it should work now.
great plugin..fantastic
Working with 2.7.1.
Thank you m8 !
Hello,
I am trying to get his plugin to work on this 2.8.4 installation and trying to sort the index page so that the posts are displayed in order by category. Can I use this plugin to sort by tags too?
thanks,
I have downloaded and installed the plugin, added all the Query to display 3 posts, but when I click on ‘Home’, it only shows the latest posting. What did I do wrong? I didn’t add any category since there are too much categories to add.
Thanks.
Oops, forgot to mention, I’m using the latest version of WP. 2.8.4.
Thanks for updating this plugin, Moshu. It’s so nice of you to fix it and get it working. I’m using WP 2.8.4 and it mostly works.
The one problem I have is that setting is_feed doesn’t seem to have any effect. When I get an RSS feed it only returns 10 items no matter what. Categories work nicely though.
I wonder if you had any insight.
It’s too bad that WordPress doesn’t allow specifying an items per page as part of the query string.
I’m really trying to figure out a way to get a feed of all the posts since someone else I work with wants the feed to incorporate blog results into a larger site search option.
If you have any insights or pointers, great. If not I’ll work something out.
As for the number of feeds - check out the Settings > Reading subpanel and increase the number of posts in feeds.
Hello - I was just wondering if there’s any way to configure the plugin to allow users to select the way they’d like an archives page to be sorted by. I’d like to give them the choice of sorting by title or date. Thanks!
Kate, I am afraid the answer is no: this plugin cannot do what you would like. Sorry…
@Moshu - Okay. Thanks for the reply, though. I’ll certainly keep it in mind for other projects.
Thank you for this fantastic plugin! I wonder if you can include “caller_get_posts” for sticky posts to behave the same way as normal posts and disappear according to the order of publication … thanks!
Thanks for this. I’m using it on Wordpress 2.9.2 to show all the posts from a particular category while the other categories on the site only show one post per page
Thanks again
This is very useful post. I will recomend this
site.
Thank you.
I have a question if anyone can help me. I want to have 8 posts displayed on my home page and 4 displayed on the subsequent pages. This does happen, however, page 2 repeats the last 4 posts from the home page. is_paged() is set to 4, is_home() is set to 8. Under the “Blog pages show at most” setting in Wordpress, I have tried all sorts of numbers and they all give me the same result– the first 8 posts on the home page, those last 4 posts repeated on page 2, the next 4 posts on page 3.
Does anyone know what I can do to get the result I’m looking for? Thanks. I put the site in the website field.
Thanks. This works great!
actually, the best type of blog is the photoblog because pictures speak a thousand words ‘
You are a god, thank you!
How can Install plugin on our WP Blog. Please tell me process. please mail me at ….
Thanks
Raj
This plugin is exactly what I was looking for, thank you!
Actually, I’ve got the same question as Deanna too. How do I show 8 posts on the home page, but only 4 on subsequent posts?
I don’t think it’s possible… at least I don’t know any way without messing with the code in the Template file(s) modifying the Loop.
@Andrea and @Moshu
During my digging around last night I found this thread: http://wordpress.stackexchange.com/questions/194/how-to-show-a-single-post-on-the-front-page-but-have-normal-paging
I haven’t got it working yet on my theme, but this might be the ticket.
I knew you could do it by modifying the code (Loop) - although that’s already beyond what this little plugin can do :)
Hi! I am having problems installing this…I am a complete noob at anything blog related, so I am sorry! I find it very simple to install a plugin, so I dont see what I could be doing wrong, except that I just updated my Wordpress to the new 3.1 version and wondered if maybe that is why this wont work?
This is what it says when I try to upload the plugin:
Incompatible Archive. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature
Thank you!
Try this:
1. download
2. unzip it on your computer
3. upload the unzipped file
4. activate in your admin panel
For some reason when I downloaded it the first time it saved it in some weird format and when I downloaded it just now and uploaded the zip file before trying what you said, it worked. So thanks!! I am sure it has something to do with my inexperience.
Thanks so much for updating the plugin so that tags now work.
i added some condition but how can i use them in my site. i didnt understand this???
I’ve gone ahead and bookmarked http://moshublog.com/2007/10/30/custom-query-string-reloaded-for-wordpress-23-with-tag-support at Digg.com so my friends can see it too. I simply used Custom Query String Reloaded for Wordpress 2.3 with tag support @ MoshuBlog as the entry title in my Digg.com bookmark, as I figured if it is good enough for you to title your blog post that, then you probably would like to see it bookmarked the same way. Your ROCK Custom Query String Reloaded for Wordpress 2.3 with tag support @ MoshuBlog !
hi there, I’ve been using this plugi nfor years now but I have a rather particular setting: I have set wordpress to display a static page called: home as my front-page.
the home page uses a custom page template based upon the default page.php of my theme and I don’t want to mess w´to much with that code.
I tried adding the condition is_front_page into this plugin but I can’t seem to get it right.
anyone able to help me out here?
If you have a Page as your frontpage, you may want to take a look at another guide in this blog: http://moshublog.com/2007/09/10/static-frontpage-combined-with-dynamic-content/
The plugin is not supposed to work with Pages…
ah, thanks. I just assumed because my page template contains a query and wordpress returns the page as home / front_page it would work…
will read the article you linked to :-)
Hi Moshu,
Thank you for this brilliant and very flexible plugin.
I recently did the Wordpress 3.1.3 security update and found my Media Library stopped working after installing. I had no thumbnails showing, and a message “No media attachments found.”
I deactivated all plugins and found that it was the CQS plugin.
After searching the Wordpress forums I ended up downloading the ‘Hotfix’ plugin. See
http://wordpress.org/support/topic/wp-313-media-library-stops-working-after-upgrade?replies=17#post-2146953
This solved my problem just wanted to putit out there incase anyone else encountered this problem
Thanks again
Thank you, Belinda, for letting me know.
I don’t have the latest WP version together with this plugin on any of my main blogs… and I forgot to check it, when 3.1.3. was released.
Probably, I should add an update to the post: people don’t read all the comments :)
Hi Moshu,
you’re welcome.. and thanks again for this great plugin.
When I clicked on the setting link then CQS it said I have no permission to view this link?
Could you help me?
hi, i am a bloody wp beginner, if i have installed the plugin … how and where in the backend can i use it?
many thanks, florian
Great Plugin sorted me out big time, with the ordering of my post tags for my events. I tried a few other wp plugins that either crashed my site or didnt work. Anyway many thanks ..
excellent plugin.. why isnt it in the wordpress site plugins though?
think a lot of others could benefit from it..