Matt Read, The Weblog

Abusing monkeys since 2003

Main Navigation


Custom Query String Plugin 2.2

Sunday, March 13th 2005

This plugin, only for WP 1.5, will allow you to set the number posts to show for all the different "query views" and each your categories in WordPress. You can choose how many posts or days, and what to order them by, for any of the queries and/or categories. All this easily set from an options page within the admin area.

Find out more at the project page.


Comments

The opinions expressed in comments are entirely the responsibility of the various contributors. While I will do everything within reason to ensure that they are not defamatory, I accept no liability for them or the content of links included in them.

  1. Comment by Sylvain

    2005-03-31T16:47:16-05:00 EST

    Thanks for this. It is very helpful. Just surprised this is not an option in the WP core.

    I have just read a thread in WP support pages and I understand you "have plugins" for this. However, still think it would be nice to have the option in the core WP to either display archives as: 1) limited to X posts (and X could be different from the main page). 2) All posts

    In the 1) option if you only display X posts and there are more then it should automatically add PAGES.

    Just a thought... thx anyway!

    Cheers, bugs.

  2. Comment by Paul

    2005-04-01T01:03:04-05:00 EST

    I think someone changed the password at your other site

  3. Comment by Matt Read

    2005-04-01T16:44:38-05:00 EST

    Paul, yeah some bright arsehole decided to take over the blog, and changed everything. so now I've changed it all back and stopped letting people login as admin. now use the login/password: test/password.

  4. Comment by Anonymous

    2005-04-14T23:15:41-04:00 EDT

    Great Plugin Matt! I was wondering how (or if I can) to go about changing the ordered by, say for date - I want it in chronological ASC and right now its going reverse (desc)?

    Thanks for any help! Sue

  5. Comment by Matt Read

    2005-04-15T01:31:22-04:00 EDT

    Sue, you're in luck. I just released version 2.0.1 which adds that option. The code is much cleaner too, and should help speed up load times.

    NOTE: Click on "Delete All" after you upgrade, because the options are different and you'll need to reset all your conditions.

  6. Comment by MCoenen

    2005-04-17T05:57:27-04:00 EDT

    Okay... I've installed the plugin (using WP 1.5) and activated it. When I go to the options/CQS, all that is returned are graphical links to WordPress and FireFox. I see absolutely no options/content as written in the .php file itself.

    I've even played with file permissions... nothing changes. Could there be a conflict with another plugin, perhaps?

  7. Comment by Steve

    2005-04-17T09:04:21-04:00 EDT

    This is the greatest plugin I have ever seen. It's sutch a fantasitc and simple idea, yet nobody has done it. If I knew whare you lived, I'd buy you dinner. Thank you so mutch.

  8. Comment by Ed Pas

    2005-04-17T10:08:20-04:00 EDT

    I have the same problem as MCoenen: plugin 2.01 is activated but nothing shows when I click in the CQS tab.

    I've checked for conflicts, and these are the ones that cause the problem:

    WP-Contact form (v1.1) Get Recent Comments (v1.0)

    I'm going to deactivate them to configure CQS and see if its just the config screen that has the conflict.

  9. Comment by Ed Pas

    2005-04-17T10:19:17-04:00 EDT

    Here's my report after some further testing. I disabled the conflicting plugins (WP-Contact Form 1.1 & Get Recent Comments 1.0) and the CQS options screen came up fine. I set up some rules and then reactivated the above two conflicting plugins. My blog is displaying as per my CQS settings (10 posts on home page, -1=all posts on most other pages). And as expected, the CQS config screen in my dashboard comes up empty aside from the header and footer.

    Matt, thanks for a great plugin. I'm content with this workaround but would be happy to help with further testing if you're going to squash the bug. If it is, in fact, a bug with your code and not WP.

  10. Comment by WordPress Italy » Archivio Blog » Plugin WordPress: Custom Query String

    2005-04-17T10:25:30-04:00 EDT

    [...] Plugin WordPress: Jump-To Plugin WordPress: Custom Query String Custom Query String ti permette di specificare il numero di articoli da mostrare [...]

  11. Comment by DebWire

    2005-04-17T12:24:21-04:00 EDT

    I attempted to get the plugin to work but apparently it conflicts with more than get recent comments. It didn't matter what I deactivated, I still came up with a blank page for CQS in the options area. Any idea for how to get this to work without deactivating an entire plugin collection? This plugin is what I've been looking for -- a way to display archives differently, etc. Thanks in advance.

  12. Comment by Ed Pas

    2005-04-17T12:54:47-04:00 EDT

    DebWire: it looks like this is a bug in WP1.5 that affects plugins that access the options pref pane in the dashboard. It think the bug has been fixed in WP 1.5.1 but I don't have that version installed—I'm still running 1.5—and haven't looked into installing the nightlies.

    As per my post upthread, you don't have to run with all of your plugins deactivated, but you need to deactivate the conflicting plugins in order to set the configuration on the CQS plugin. For my site, I did the following:

    1. deactivated all of my plugins except for Custom Query String
    2. set the options in CQS in Options->CQS
    3. left CQS activated and reactivated all of my other plugins

    It broke a lot of stuff on my blog for the 3 minutes or so that I spent configuring CQS. Now everything seems to be running fine.

  13. Comment by Ed Pas

    2005-04-17T13:51:23-04:00 EDT

    According to Owen at asymptomatic.net, another solution is to use the 1.5.1-alpha version of the menu-header.php. The comment I've linked to has a download link for said file. I've installed it on my system and everything's happy now. No deactivated plugins, no empty config screens.

    Disclaimer: mixing files from different versions of WP could do bad things. Make sure you have a backup before you start messing around.

    Sorry to keep spamming your site, Matt. I'll shut up if you want. Just let me know.

  14. Comment by bodmas » Blog Archive » Strayhorn runs bodmas

    2005-04-17T15:15:47-04:00 EDT

    [...] generate archive and category pages – I have changed this to full post content The Custom Query String Plugin by Matt Read allows different numbers of pos [...]

  15. Comment by Matt Read

    2005-04-17T19:06:07-04:00 EDT

    Ed Pas, MCoenen, Debwire, this is quite strange. I will attempt to see if I can reproduce the error, although I'm running 1.5.1 alpha.

    Ed Pas, yeah bug #902 is cause of many problems like this and could possibly be the cause of this. I would apply the patch that they give there. Also thanks for the debuging, I love when other people solve my problems, so comment all you want. Nice job.

    So everyone go get the new menu-header.php file, or apply the patch manually, it's only two small lines to edit. Hopfully that will fix everything. If not please let me know.

    Also note the CQS options page is only available to user_level of 9 or greater.

  16. Comment by Matt Read

    2005-04-18T00:12:20-04:00 EDT

    UPDATE

    I have put together a patched file for WP 1.5 to fix Bug #902. Just upload replacing the current file.

    Get the patched file: menu-header.php

  17. Comment by MCoenen

    2005-04-18T03:45:29-04:00 EDT

    Works now since I uploaded the patched menu-header.php file. Thanks for your help... GREAT plugin... (also not sure why this isn't a core WP option, either).

  18. Comment by Ed Pas

    2005-04-18T04:41:42-04:00 EDT

    Matt, just to clarify from one of my posts above:

    It broke a lot of stuff on my blog for the 3 minutes or so that I spent configuring CQS. Now everything seems to be running fine.
    The "breaking" was the stuff on my template that required the deactivated plugins (recent comments, contact form, etc.). It had nothing to do with yours. This seems obvious, but could be misinterpreted.

    And with the WP patch applied, everything does, indeed, run fine.

  19. Comment by Nicola

    2005-04-20T15:34:04-04:00 EDT

    I find your plugin very useful but I what I need for my site is slightly (I think) different functionality. I need a plugin that lets you set the number of posts per page depending from category. So in category news I would like to display 10 posts per page and in category work 5 posts. Can you please suggest me how can I modify your plugin to accomplish this.

    Thanks for any input.

  20. Comment by Kimiko the Furball

    2005-04-28T06:53:56-04:00 EDT

    Hello,

    thank you for making this script. Much like Nicola however, I'm looking for a different approach. It would be nice to see a plugin that let's you modify the number of posts and sort key/order for each of the categories.

    I want all my categories except those under let's say "Category X" to be ordered by postdate DESC (like any other blog), but for "Category Y" I want it to be postdate ASC or maybe postname ASC.

  21. Comment by Andrew

    2005-05-04T14:38:05-04:00 EDT

    Matt... Thanks for the plug-in. I want to give it a try, but I am having a problem even more troublesome than what has been described above.

    I added this plug-in. So far it is the only active plug-in. I JUST installed and downloaded the WordPress yesterday (I am very new to blogging and WordPress especially). When I click on the CQS link, I get a message that there was no input file specified and then I look at the url in the address bar and I got this: http://{my domain}/wp-admin/D:/clients/{my domain}/wp-content/plugins/custom-query-string.php (The {my domain} is where my domain name goes.) What I can't figure out is why it is putting in the drive letter path....

    Any ideas?

  22. Comment by Jeff Mikels

    2005-05-05T18:40:53-04:00 EDT

    Please change your Options Menu code...

    It should have basename(FILE) instead of FILE /* * Add options page link to admin menu. * Only accessible by userlevel of 9 or greater. */ function cqsoptions() { addoptionspage('CQS Options', 'CQS', 9, basename(FILE), 'cqsoptionsinit'); }

  23. Comment by Jeff Mikels

    2005-05-05T18:41:59-04:00 EDT

    Those FILE s above should have double underscores on either side. (They were stripped from my post.)

  24. Comment by Jeff Mikels

    2005-05-05T18:48:45-04:00 EDT

    One more comment: (FEATURE REQUEST)...

    Would you please be able to make it so that the query can be customized not just for is_category() but also for specific categories? I would like certain categories to have an ascending order but others should be in descending order. Is that possible?

  25. Comment by i-do » Blog Archive »

    2005-05-07T12:45:26-04:00 EDT

    [...] r post in the same category on the same one page ( not to the permanent link) By utilising Matt Read’s Custom Query String, Ryan Boren’s Front Page Category [...]

  26. Comment by i-do » Blog Archive » Varied number of posts in specific paged page.

    2005-05-07T12:53:29-04:00 EDT

    [...] 2005.05.07 By utilising Matt Read’s Custom Query String and set ispaged/ishome to show 1 post on [...]

  27. Comment by Matt Read

    2005-05-09T00:44:46-04:00 EDT

    Nicola, Kimiko the Furball, Jeff Mikels,

    I added support for sorting on a per category basis in 2.2. So upgrade and hopefully it will all work as planned.

    Andrew,

    Try upgrading to the recent version 2.2. Should work now.

  28. Comment by Diana

    2005-05-11T16:37:33-04:00 EDT

    Hello, Thanks for the plug-in. It's working really nicely on my art site. However I did find one bug. If you customize your permalinks to display the name instead of the number ID the plug-in will not recognize the categories anymore and thus it won't work...

    It's not a big deal over all since I just returned to using the number ID's but I do wish I could use the more descriptive permalinks instead. I'm using WP version 1.5.1.

    -Diana

  29. Comment by Candice

    2005-05-31T02:17:40-04:00 EDT

    I've reread your entry several times and I still cannot find the link to download this plugin! Has it been removed?

  30. Comment by Matt Read

    2005-05-31T17:05:38-04:00 EDT

    Candice, OOPS! My fault, it's back up now hahahah

  31. Comment by Stacy

    2005-06-05T14:45:25-04:00 EDT

    This is great!!

  32. Comment by Outwit, Outblog, Outsnark » Help Me, Oh Blogging Wizards

    2005-06-05T14:47:47-04:00 EDT

    [...] the problem? And I was wondering why I hadn’t upgraded to WP 1.5 yet. Yay! Found a plug-in that provides a ton of flexibility and makes everything w [...]

  33. Comment by Orlando

    2005-06-07T13:07:47-04:00 EDT

    This plugin helps us to overcome a minor "mistake" of WP 1.5, compared with 1.2 - > a more user friendly archives view. Thks a lot for it.

  34. Comment by Slightly Remarkable » Blog Archive » Wordpress Problem

    2005-06-11T15:30:28-04:00 EDT

    [...] forums have been so kind as to lead me in the right direction — my solution was the CQS plugin for Wordpress.

    Tags: wordpress, blogging, repair   
     Pos [...]
    
  35. Comment by hyperpup » Custom Query String

    2005-06-18T02:24:27-04:00 EDT

    [...] ってしまう見にくいものになってしまう。 そこで見つけたのがこのCustom Query String。これはテンプレート毎に加え、

  36. Comment by brickred.com

    2005-06-29T10:23:22-04:00 EDT

    Yes! Nice blog for all.

  37. Comment by cardssolutions.com

    2005-07-01T10:24:38-04:00 EDT

    Hi! This is realy good blog.

  38. Comment by Brian Bonner

    2005-07-02T19:49:21-04:00 EDT

    Great program thank you!

    One request. I was wondering if some sort of page function could be incoperated into the program. For large categories and for when people use the month option and don't understand using the calendar. I want all the posts available in a x post per page format. and at the bottom have a next page link.

  39. Comment by mein Weblog und seine Plugins

    2005-08-20T17:44:43-04:00 EDT

    [...] ilen. Michael Hampton’s Bad Behavior Hält mir den Spam von meinem Weblog. Matt Read’s Custom Query String erm&#2 [...]

  40. Comment by SEO Plugins für WordPress

    2005-08-21T20:43:59-04:00 EDT

    [...] h für SEO nutze und die mir darüberhinaus bekannt sind. Matt Read's Custom Query String bietet [...]

  41. Comment by Broken Kode » Blog Archive » WordPress Wishlist

    2005-09-06T15:13:36-04:00 EDT

    [...] Now I know Chris is working on this, but he seems to be having a wee bit of trouble implementing the thing. So I’m going to put it out there, maybe someone’s got the answer because they’ve done it already etc. What I’m looking for here is a simple plugin that will download my posts and all associated information (not so bothered about comments although that would be an excellent feature), in a specific order, for a specific period of time. The alternative is to make a theme and download that, which I did, but it doesn’t have the level of control a plugin has, and also it would have to be used with a plugin such as the Custom Query String plugin (which isn’t working 100% for me for some reason) to control how the order the posts are shown. Posted in Wordpress [...]

  42. Comment by Broken Kode » Blog Archive » WordPress Wishlist

    2005-09-06T15:14:14-04:00 EDT

    [...] Now I know Chris is working on this, but he seems to be having a wee bit of trouble implementing the thing. So I’m going to put it out there, maybe someone’s got the answer because they’ve done it already etc. What I’m looking for here is a simple plugin that will download my posts and all associated information (not so bothered about comments although that would be an excellent feature), in a specific order, for a specific period of time. The alternative is to make a theme and download that, which I did, but it doesn’t have the level of control a plugin has, and also it would have to be used with a plugin such as the Custom Query String plugin (which isn’t working 100% for me for some reason) to control how the order the posts are shown. Posted in Wordpress [...]

  43. Comment by hyperpup » Sunshine on a cloudy day

    2005-10-05T05:32:56-04:00 EDT

    [...] First, I created home.php for my HOME, and 5 category templates as category-x.php(x is the category ID) for my 5 main categories, “Daily Life”, “Web”, “Languages”, “Travel” and “House”. Each category has some child categories that follows the category.php that shows the posts as title list. I use Custom Query String plugin to show the different numbers of post titles from category templates. In home.php, I use 2 Loops, 1 is for “Latest Updates” and the other for “Announcement” with query post, and the other posts (those on sidebar and message with welcome photo) are shown with the plugin wordpress asides coldforged style. I am using 2 loops because I wanted to have “NEW!” with the new posts. <?php if ((time() - getthetime('U')) / (606024) < 3) { echo "<font color="#dd0000"><small>NEW!</small></font>"; } ? > With this code above, “NEW!” will be shown with the posts posted within 3 days with colored (#dd0000) small font. Thanks sasa for this useful trick. [...]

  44. Comment by Rodrigo Muniz » Rebooters, faltam 4 dias! (Tecnologia, Fotografia, Webdesign, Padrões web, CSS, Usabilidade, Downloads, Diversão nerd)

    2005-10-27T15:11:25-04:00 EDT

    [...] São 4 dias para o CSS Reboot. Mas o que seria o CSS Reboot? É um evento muito legal de uma comunidade de webdesigner que está crescendo muito. O esquema é simples: eles combinam um dia pra todo mundo colocar um redesign do seu site no ar, não é uma competição, é um exercício para todos renovarem os layouts de seus sites. Depois esses serão avaliados e votados com classificações de 1 a 5 estrelas. O mais legal é o movimento de tanta gente (927 Rebooters até então) para divulgar os padrões da web com criatividade e mostrar toda a flexibilidade dos layouts CSS + XHTML. Mesmo com problemas de host e domínio estou fazendo um novo tema e vou participar dia 1º de novembro. O novo tema (In Lite) se baseia na idéia de ser leve e maleável. Finalmente consegui fazer um layout flexível com as tais porcentagens, aprendi muito com ele. No tempo dos layouts com tabela as porcentagens eram simples de serem trabalhadas, mas quando você trabalha com elas no CSS e vê que precisa aplicá-las nas margens, por exemplo, a coisa fica muito mais lógica. Claro que nem tudo são flores, o IE não ajuda e vem com seus bugs estranhos. Um deles acho que todo mundo conhece, quando se passa o mouse emcima de um link a largura da página estica como que se dobrasse de tamanho. Só a Microsoft pra fazer esses efeitos especiais. Mas dessa vez ela não está sozinha. O Opera insiste em colocar uma barra de rolagem horizontal enorme em todas as páginas. Já modifiquei tudo, refiz o CSS, mas a barra de rolagem horizontal gigante não sai de la de jeito nenhum. Estando ótimo no Firefox, bem no IE e regular no Opera… Finalmente vou implementar uma pequena galeria com meus trabalhos fotográficos favoritos. Outra coisa que vai mudar é o fluxo do conteúdo do blog. Instalei o plugin Custom Query String, com ele você consegue controlar q quantidade de posts de cada seção do Wordpress. Na home vai estar apenas o post mais recente o que deixa a página com o carregamento ainda mais rápido para conexão discada. Bem, se você tem um site ainda dá tempo. Se tiver um tempinho se inscreve e poe a mão na massa! del.icio.us it [...]

  45. Comment by Polaroid » Blog Archive » About

    2005-10-30T20:55:21-05:00 EST

    [...] + Wordpress 1.5 + WP Paginate Plugin + Custom Query String Plugin [...]

  46. Comment by WordPress Theme 'Gold' (SEO)

    2005-11-16T17:53:46-05:00 EST

    [...] Admincenter==>Optionen==>Amazon. Custom Query String. wp-content/plugins/custom-query-string.php. [...]

  47. Comment by Ajay D'Souza

    2005-11-29T10:24:35-05:00 EST

    Where is the download link Matt?

  48. Comment by Jeremy

    2006-01-09T16:08:22-05:00 EST

    Hi there,... any luck that this will be updated for WP 2.0?

  49. Comment by browserd

    2006-01-11T08:12:46-05:00 EST

    Hi there. This could be a really nice thing to use in WP 2.0... Any luck?

  50. Comment by hyperpup » WordPressユーザに聞きたい10の質問

    2006-01-12T09:36:27-05:00 EST

    [...] Custom Query String 各カテゴリ、Pageで表示できる投稿の数を設定できる。 [...]

  51. Comment by Hikoto

    2006-01-14T12:10:29-05:00 EST

    I have the same queries as the 2 above me, Jeremy and browserd. I know this sounds stupid but if I can't continue with this plugin for Wordpress 2.0, I might not upgrade it because my blog really depends on it...lol.

    Hope to hear a reply soon!

  52. Comment by Matt Read

    2006-01-15T02:56:42-05:00 EST

    2.7 is out, which supports WP 2.0! ;)

  53. Comment by SEO Plugins Wordpress

    2006-01-19T15:45:10-05:00 EST

    [...] Custom Query String [...]

  54. Comment by Show All Posts on Category Page in WordPress

    2006-01-19T17:04:24-05:00 EST

    [...] Recommended solutions to this are the Perpage and Custom Query String plugins. Haven’t taken them for a spin yet in WordPress 2.0. [...]

  55. Comment by Kathy Sargent

    2006-01-21T23:12:14-05:00 EST

    Get the latest information on Estate Planning and wealth Management.

  56. Comment by » Dicas depois de instalar o Wordpress - Rodrigo Muniz + Tecnologia, Webstandards, CSS, Internet, Web design, Cultura, Fotografia, Música...

    2006-01-24T17:30:26-05:00 EST

    [...] Update 24/01/06: Controle melhor as quantidades de posts exibidos No Wordpress, indo em “Options > Reading > Show at most” você pode configurar um número de posts para que ele exiba na home, no resultado de um busca, na página de uma categoria e por aí vai… Com o plugin Custom Query String você pode configurar o número de posts de cada seção do blog. Por exemplo, atualmente uso aqui para deixar apenas 1 post na home e 15 nos resultados de busca. [...]

  57. Comment by Mediengestalter

    2006-03-14T13:49:49-05:00 EST

    Version 2.7 is very nice. Congratulations!

  58. Comment by Mediengestalter

    2006-03-14T13:55:38-05:00 EST

    Version 2.7 is very nice. Congratulations! hahahah

  59. Comment by deepesh

    2006-04-29T07:48:21-04:00 EDT

    ANMsoft is a software outsourcing Indian company with clear focus on high quality, timely delivered and cost-effective offshore software development services. With our experience in providing offshore software development, project management capabilities and standards, ensures us to develop solutions that give your business an edge. Our global software outsourcing model delivers maximum targeted result.

  60. Comment by pawan

    2006-04-29T07:51:31-04:00 EDT

    Offshore software development by anmsoft focus on e-commerce & banking solution. we offer offshore development onsite / offsite consulting service for shopping sites, E-Store, travel, matrimonial and other banking & e-commerce solutions centre at ANMSOFT, Mumbai India.

  61. Comment by Фотоблоги России » Можно ли создать фотоблог на Wordpress?

    2006-05-05T07:28:18-04:00 EDT

    [...] Недавно мне задавали вопрос, можно ли создать фотоблог на движке Wordpress? Отвечаю - можно, хотя лично я предпочитаю специализированные движки. Здесь можно найти несколько тем, созданные неким Taly специально для организации фотоблога. Для корректной работы этих тем необходимо установить два плагина: WP Paginate и Custom Query String. Еще один проект носит название Nigiri Suchi. На странице проекта можно скачать (beta 2) тему и посмотреть примеры фотоблогов, созданных на основе этого шаблона. Tags: wordpress, скрипты [...]

  62. Comment by Wordpress Plugins I like. (Tacoen Hypertexted)

    2006-06-24T00:01:53-04:00 EDT

    [...] Custom Query StringChange the number of posts displayed when viewing an archive page. [...]

  63. Comment by a laundry list of hand-wringing apologies » Live Reboot

    2006-07-06T11:33:42-04:00 EDT

    [...] …at least that’s what kristin calls them.  Hers seem to go a lot more smoothly than I think this will.  I’ve got most of the formatting/CSS under control, but the limitpostlength stuff is not going as smoothly as planned.  Right now all the html is getting stripped from posts, and the posts are reeeally short.  I may just give up and use custom query string to shorten the front page, and worry about the rest later. Anyway, the whole thing is built on Squible Beta Two, which karrde and theron parlin just put out.  The comment form is stolen wholesale from Fauna B5, and there’s some CSS naming borrowed from Unsleepable. [...]

  64. Comment by Livrarias Livro Técnico » Dicas depois de instalar o wordpress

    2006-07-25T18:22:16-04:00 EDT

    [...] Update 24/01/06: Controle melhor as quantidades de posts exibidos. No WP, indo em “Options > Reading > Show at most” você pode configurar um número de posts para que ele exiba na home, no resultado de um busca, na página de uma categoria e por aí vai… Com o plugin Custom Query String você pode configurar o número de posts de cada seção do blog de forma independente. Por exemplo, atualmente uso aqui para listar apenas 1 post na home e 10 nos resultados de busca. [...]

  65. Comment by Anonymous

    2006-09-07T22:48:11-04:00 EDT

    Great plug-in!

    Found out about it at http://wp-plugins.net/ and just wanted to let you know that the plug in description doesn't show because of a problem with the character encoding (not UTF-8?)

    Thought you'd like to know...


Leave a Comment

Before leaving a comment, please ensure you have read and understand my comments policy and my privacy policy. Any comment that does not abide by the comment policy will be deleted immediately.

Your Information (required)