This version adds two query options:

OR query

?fruit=apple,orange,pair

will match all posts that have the fruit field set to apple OR orange OR pair.

AND query

?color=red+orange+yellow

will match posts that have 3 color fields: one with red, one with orange and one wih yellow.

These capabilities are disabled by default. Before you enable them from Posts -> CF Taxnomies, a word of caution:

If some of your field values have commas ‘,’ character in them, don’t enable the OR query.

Also, if some of the field values have spaces ‘ ‘ in them, don’t enable the AND query.

Currently, you can’t enable both the AND query and the “Show posts that don’t match all key=value pairs” option. This will probably be fixed in the future.

Comments (28)

  • ricmas says:

    Hi, first of all thans for this plugin!!
    I’m a student newly with wordpress and php, trying to build a site for an exam.
    I installed your Developement version (1.3a) with Wordpress2.8. Used it to generate a tag cloud of custom field (registered as taxonomies) values in my home page. Click on a word gets a new page (I copied the meta.php in my template folder) where are listed all the posts with that word in the custom field. All work fine!!!

    I have two questions:

    1) How can I hide specific values from the custom field cloud ?
    (tried but nothing)

    2) It’s possible to set the new page title so it corresponds to the clicked word?
    ( get_meta_title() in my meta.php doesen’t work)

    I’m doing something wrong, hope you can help.
    Sorry for my english and the time spent reading.

    • scribu says:

      I’m glad you like it. Before you do anything, upgrade to the latest version: 1.3.1.

      Now:

      1) I will write a post explaining how to do that.

      2) Maybe you forgot the echo:

      echo get_meta_title();

      If that doesn’t solve it, send me your meta.php at scribu@gmail.com so I can take a look at it.

  • ricmas says:

    Thanks a lot!!!!!!!!! You were right, I forgot the echo… now it’s fine!
    I’ve installed the developement version because with the 1.3.1 an error was given (something like “Warning: array_merge() ..”).
    I don’t want to loose the data stored in my DB and custom fields (I’ve few days to complete my work and friends are helping me with data entry), it will happen if I upgrade to 1.3.1 version?
    I’ll wait for your post about how to exclude a value from the cloud.
    Again thanks, thanks, thanks!!!!!!!!!

    • scribu says:

      You’re welcome :)

      That error was with version 1.2.

      You won’t loose any data if you upgrade to 1.3.1.

      About upgrading, you might want to wait for version 1.3.2, since I decided that I’ll add a parameter to make it easier to exclude terms from the meta cloud.

      • ricmas says:

        Thanks for the fast reply you’re a helpful person.

        I’ve updated to 1.3.1 version and it’s all ok. Tried again to exclude a custom field value writing

         

        or to change the order

         

        , but nothing moves on my page.

        I got confused…. it’s correct to use the wp_tag_cloud arguments??? (read in your template-tags.php “$cloudArgs: see wp_tag_cloud() for available args (optional)”).
        I apologize for asking again but I have in my cloud the word ALL and it’s so fastidious.

        • ricmas says:

          Oh sorry my code in the previous reply was this

           meta_cloud('key=tecnica', 'number=50', 'exclude=3');
          • scribu says:

            The correct code would be:

            meta_cloud('key=tecnica', 'number=50&exclude=ALL');

            Yes, it’s correct to use the wp_tag_cloud() arguments, because meta_cloud() uses that function internally.

            The exclude argument doesn’t work yet, but it will in version 1.3.2. I’ll check the orderby argument too.

  • ricmas says:

    Thanks a lot! I’ll search another way to solve while waiting for the new version.

  • Bernhard says:

    great plugin! Is it right, that it is only working for POSTS, but not for PAGES??
    I´m urgently looking for something similar fot PAGES. I´m using the “custom field template”-plugin to create the costum keys/values in PAGES.
    Thanks for help!

    • scribu says:

      I’m afraid it won’t be easy to make it work with pages because they are treated differently by WordPress. But why are you using pages?

  • Morgaine says:

    As was mentioned before by someone back in March, this plugin breaks the normal search. I noticed my search wasn’t working, but didn’t know when exactly it stopped working. So I installed a brand new WordPress (2.8), in a different subdomain, using a brand new database. Everything worked. Then I added the plugins I am using on my regular blog, and search didn’t work. Deactivated all, enabling them one by one, each time testing the search. When I enabled your plugin, search stopped working. To make sure it was due to your plugin, I deactivated all plugins but yours. Search still didn’t work. I am using permalinks, with a structure of /archives/%year%/%monthnum%/%day%/%hour%.%minute%.%second%, a category base of archives/categories and a tag base of archives/tags. I’ll test whether the problem remains, when using no pretty permalinks.

  • Separatista says:

    Hi, great plugin! I have several questions:

    - Is it possible to use permalinks? That means not http://example.com/?foo=bar, but http://example.com/foo/bar?
    - Is it possible to show another key in URL? That means that I have custom field key wp_value1 and I do not want to replace it (there are other things dependent), but I would like to show URL http://example.com/?foo=bar and not http://example.com/?wp_value1=bar.
    - Values in other languages are not very nice. For example “Jiří Antoš” is in URL http://example.com/?foo=Ji%C5%99%C3%AD+Anto%C5%A1. It would be much more better http://example.com/?foo=jiri-antos (or the best permalink http://example.com/foo/jiri-antos).

    And not related to this plugin: Comment field in IE7 on this web does not work correctly, when you write more than 1 row, you can not see previous row…

    Is this plugin gettexted, so can be translated? I did not find .pot file in its archive…

    Thank you for this plugin…

    • scribu says:

      For the 3 points, I’m afraid you’ll have to use the Custom Taxnomies plugin – custom fields can only be stretched so much.

      The only thing I could do in this respect is to write something that migrates from custom fields to native taxonomies.

      And no, it’s not currently translatable.

      • Separatista says:

        Yes, I know about for example Simple Taxonomies plugin and it works well, but I have all related data saved as custom fields (and I am not alone). It would be very helpfull for many users to have some kind of “bridge” between custom fields and taxonomies in the way described above (key = taxonomy, values = tags). There is also related problem – could be this migration someway scheduled or automated? Because there are other plugins which automatically create new custom field values which should be migrated into taxonomies…

        Thank you very much!

        • scribu says:

          Yes, I suppose it can be automated. It’s not an optimal solution, but it could work.

          • scribu says:

            I think it would be best as a separate plugin.

            • Separatista says:

              I am not sure, but I am looking forward to this feature. It would be fine to have everything in one plugin (migration + showing custom taxonomies for example in widget) not to be dependent on other plugin from other author, but it is also not serious problem. Custom fields should stay where they are now, only taxonomies could be created from selected custom keys (and do it automatically every day or post is created / edited). Thank you very much, many users will appreciate it, I guess…

            • Separatista says:

              Hi, sorry for bothering you, but is there any progress?

              • scribu says:

                Yes, I’ve got a script that inserts custom fields as terms. Pretty basic, but it works.

                However, I don’t know how the synchronisation would work.

  • lizhard says:

    Is possible rewrite urls? Like /customFieldName/customFieldValue.html?
    Great plugin