Another substantial update for y’all:
Revamped Admin Page

The new admin page is built up entirely of shiny 2.7 style boxes. They work just like the ones on your dashboard.
The admin page has been moved to Posts -> CF Taxonomies for easier access. There is also a new feature to add default values.
Enhanced sorting
Version 1.1 introduced an option to display posts with a relevance less than 100%. Now you have an extra option to also adjust the relevance based on the order of the query vars in the URL.
For example, if your URL is http://example.com?foo=xxx&bar=yyy, posts that don’t have bar=yyy, but have foo=xxx will rank higher than those that have bar=yyy but don’t have foo=xxx.
Important bugfix
In earlier version, if you used query_posts() anywhere in the template file that was used by the plugin, you would get all kinds of errors. Not anymore:
Now you can use query_posts() and even have multiple loops on the same page and CFT will only modify the main loop.

version 1.2 is still compatible with wp 2.6?
Yes, but the admin page might look slightly different from the screenshot.
Not with 2.5, though, since the “postboxes” Javascript variable isn’t available.
You mean it doesn’t work at all, or just the Javascript?
Love the new admin page!
How could one detect the presence of meta_relevance? If I have a div that I want to show styled for relevance and only have it appear when relevance returns something, how can I detect that?
You could do something like this:
Perfect thanks!
Bah – sorry that actually doesn’t work I think because the_relevance() function always returns an echo. Could there be another function that simply does a return instead of echo?
Sorry about that. Upgrade to version 1.2.0.1 and use meta_relevance($echo = false).
hi there.. nice to know the new release of this plugin. i have a little problem here. when i activate this plugin, it will somehow “crash” (i dont know what to say) with search function, it will give a “no results” in every query in search function. i thought this will fix in the future release, but i dont see in this release. or do i miss something here? together with this plugin i use these: WordPress.com Stats,WP-PageNavi,WP-PostRatings,WP-PostViews,WP-Print and one old plugin “Custom Query String”
Probably “Custom Query String” is the one causing the problmes. Have you tried disabling all plugins and trying the search?
Hi, is it possible to get around the fact that the plugin doesnt display results for posts which have more than one meta_value for one meta_key?
I’m using a form with method=”get” to search posts by multiple custom fields. So I have a drop down for ‘area’, ‘menu’, and a text box for ‘restaurant’. the ‘menu’ meta key has more than one meta value for some posts.
So, to get all entries the url on form submission is: http://www.mysite.com/?area=&menu=&restaurant= but this only displays posts where one meta value exists for meta key = ‘menu’.
Anyway to show posts with multiple values for ‘menu’?
I don’t mind tweaking the code with a little hint. Or is there anyway to remove the “&menu=” part of the URL upon form submission when the default value is selected?
So the problem is only when nothing is selected for menu. If something IS selected for meta key ‘menu’ then the correct posts are displayed even if they have more than one meta value for ‘menu’.
Thanks for reading.
In query.php, try replacing this line (88):
$having = ' HAVING COUNT(post_id) = ' . count($this->query_vars);with
$having = ' HAVING COUNT(post_id) >= ' . count($this->query_vars);sorry for not using REPLY the first time.
First, thanks for your input. The change you highlighted DOES fix the problem of showing all posts.
However, prior to this change and with this change I still have an issue that when I do something like this I get the correct results PLUS those posts that have more than one meta value for ‘menu’:
mysite.com/?area=london&menu=&restaurant= will give all the posts with area = london, BUT ALSO all the posts where ‘menu’ has multiple entries and area=something else.
I’ve confirmed that I have UNCHECKED the Setting for show all posts that don’t match all key value pairs, as I am only looking for results that are a 100% match.
Well, I found one way to get around my problem although I’m not sure it is the best solution.
I know use a form with method post, and action is a new php redirect file. This redirect file has two conditions, when ‘menu’ is NULL and not NULL. When it is NULL, it removes &menu= from the URL giving me all my results including those that have multiple meta values for meta key ‘menu’.
If there is a better solution, I would like to know.
Thanks for reading.
Thanks scribu for that SUPER FAST response, I’ll check the change to the condition you mentioned >= and see what happens!!
One more question. Can I please get a usage example for outputing meta_cloud() function in the template? I think I have stupid syntax error somewhere which is making me pull my hair out since I don’t get any out put.
In addition, are the ‘key’ values case sensitive? Since it doesn’t seem to matter when using in the URL but it might here.
Thanks.
meta_cloud('key=your_key', 'number=100');That is equivalent to:
meta_cloud(array('key' => 'your_key'), array('number' => 100));The second set of args is optional and yes, keys are case sensitive in this case.
Hi scribu, how do we sort order query results by a specific meta key value? I assume we can change the parameter on line 103 of query.php:
function posts_orderby($orderby) {return "meta_rank DESC, " . $orderby;
}
Will that work? How do I specify orderby “meta value of a certain meta key”? In other words alphabetically by custom field value.
Thanks for your help as ususal.
I don’t know how you might achieve that through SQL, but it might be easier to sort the posts after they are retrieved, using PHP’s usort():
Scribu:
Please checkout
http://wordpress.org/support/topic/263013?replies=4
I can’t get 1.2 to work at all and I’m getting the same bug that is described here.
Thanks for bringing it to my attention.
OK…any suggestions for how to fix it? In the meantime, is there a place to download earlier versions of the plugin until this is fixed?
http://wordpress.org/extend/plugins/custom-field-taxonomies/download/
Hello,
Is this plugin compatible with the new “custom taxonomies” feature available on Wordpress 2.8?
My biggest concern is about some kind of conflict between taxonomies created using the plugin vs. using WP’s native admin panel.
More info about WP 2.8’s taxonomy here:
http://justintadlock.com/archives/2009/05/06/custom-taxonomies-in-wordpress-28
Yes, it’s fully compatible because it’s completely separate from the native taxonomies: meta taxonomies are stored in wp_postmeta whereas native taxonomies are stored in wp_terms etc.
How would I search for multiple values for a field? Can I separate them with commas? for example:
http://website.com/?key1=value1,value2,value3&key2=value4...
I’m afraid multiple value search is not available yet. If it gets implemented, it will probably be a comma separated list, as you suggested.
Hi scribu,
I have a usage question.
Is the string only used on the root?
Can it be used for categories as well?
eg.
http://website.com/category/?foo=bar
If http://website.com/category/?foo=bar is a valid category page, it will work. It also works for author pages, tag pages and all the rest.
Hi scribu,
Sorry for the late reply.
I’m just wondering how this would work on author pages.
Since author pages do not have custom fields, how would that work?
The author pages show posts and posts do have custom fields, so it works just like on your home page.
Is there a way to an AND based search? In other words I want to query posts that have key1=value1 AND key2=value2
No, not yet. I plan to include that capability in version 1.3.
When is that going to be released (ballpark)?
Erm… early July, I think.
If you don’t need to “Show posts that don’t match all key=value pairs”,
then you can grab version 1.3a right now from WP Extend -> Other Versions -> Development version.
Works pretty good! Thank you for being so responsive to requests!
You’re welcome. This part was easy to implement.
Howdy – I am running WP v2.8 and v1.22 of this plugin. When I try to register a taxonomy, I get the following error message:
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /var/www/wordpress/wp-content/plugins/custom-field-taxonomies/inc/scb/Options.php on line 60
Are you seeing this error in any other situations? Is there any additional information that I might be able to provide that might allow you to provide some suggestions?
Thanks in advance,
-M
I am using the same versions and getting the same error as Michael Acosta.
I thought it might have been a clash with another custom field plugin,(Custom Field Template by Hiraoki Miyashita and get custom field values by Scott Reilly) but I deactivated them and still got the error.
Oh! just saw the note about the development version, so I will try it.
Development version didn’t get the error.
Woo Hoo!
I used version 1.2.2 in WP 2.7 and it worked perfectly. After installing 2.8 everything is gone apart from the settings page. No boxes on the new post or edit.
HELP?
@Michael Acosta and @Lodewijk Bos:
Please try the development version (1.3a).
I’m sorry, no effect. de-activitated and re-activitated it, no effect
Could you make a screenshot and mail it to me?
Could you send me your email? I have shot from the plugin page, from a new post and from the settings page. Let me know if you need anything more.
http://www.icmcc.org/wp-content/uploads/2009/06/screen3.jpg
http://www.icmcc.org/wp-content/uploads/2009/06/screen2.jpg
http://www.icmcc.org/wp-content/uploads/2009/06/screen11.jpg
This is quicker..
PS the database tables are still intact.
It seems you’re confusing Custom Field Taxonomies with Custom Field Template:
CF Template adds the admin boxes for insterting the custom field data.
CF Taxonomies (this plugin) does the magic on the front-end.
The problem you’re having is related to CF Template.
sorry to correct you. if taxonomies were working, it should show taxonomy boxes on the new post page underneath the tag box, wouldn’t it? I’m not confused.
As I said, the settings pages is showing, but no taxonomy boxes nor any of the functions in the posts.
This plugin doesn’t add any “taxomony boxes”. Those are added by Custom Field Template.
This plugin only adds a settings page in the admin.
I sincerely apologise for taking up your time. I got confused with a taxonomy plugin. Thank you for your time, I really appreciate it.
That’s alright. It’s easy to get confused:
Custom Taxonomies, Custom Field Taxonomies, Custom Field Template