Using WordPress page title as category name
In PICK relationships when you call category.name = "name" is it possible to have that name be the WordPress page title? This will save me from creating multiple page templates to call categories on different pages. So, I create a WordPress page called "Locations" as well as a PICK relationship "category" call "Locations"....
Here is what I've tried, but it yields nothing: $title = wp_title('', false); $services->findRecords(null, null, "category.name = '$title'");
The original looks like this and yeilds results: $services->findRecords(null, null, 'category.name = "Locations"');
edited Nov 16 '11 at 5:22
2 Answers
Have you looked at what wp_title('', false) is actually returning? The WP Codex entry for wp_title contradicts itself. Part of the codex shows your syntax for eliminating the », other parts show that your syntax should be wp_title(' ', false). You might also want to try get_the_title() instead. That function can also add cruft.
You might also want to consider defining a pick field based on a wp post.
Brilliant! get_the_title() worked. Thanks so much!


