Using WordPress page title as category name

0

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"');

asked Nov 16 '11 at 5:20

krmediadesigns

20

edited Nov 16 '11 at 5:22

add comment
enter at least 15 characters

2 Answers

1

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.

answered Nov 16 '11 at 6:02

chris.pilko

889

add comment
enter at least 15 characters
0

Brilliant! get_the_title() worked. Thanks so much!

answered Nov 16 '11 at 9:31

krmediadesigns

20

add comment
enter at least 15 characters