Home › Forums › MapPress Support › Mashup with Taxonomy
- This topic has 6 replies, 2 voices, and was last updated 12 years, 7 months ago by
bfeather.
-
AuthorPosts
-
January 9, 2014 at 7:24 am #14048
[mashup query="post_type=church"] works as expected.
But, when I add a taxonomy, I get no results.
[mashup query="post_type=church&fellowship=rpca"]Both custom post type and taxonomy are created by Types/Views Toolkit.
What am I doing wrong?
Thanks.
January 9, 2014 at 7:53 am #14049Hi,
The query looks OK. Double check that:
– fellowship and rpca are the corrent name and slug for that taxonomy
– you have maps in the posts with taxonomy fellowship = rpcaIf you’re still getting a blank map, there is probably an issue with the query. One way to validate the query is correct is to try it in your browser. For example:
http://www.example.com/church/?fellowship=rpca
Another way to test it is to output the query result in the theme. Add this to a template file such as ‘index.php’ or ‘footer.php’:
<?php $wpq = new WP_Query("fellowship=rpca"); print_r($wpq); ?>January 9, 2014 at 8:05 am #14050Chris,
Typing the query into the browser results in a map for each of the rpca churches, as expected I believe. They are in groups of 10, also as expected.
What else could be wrong?
Thanks for helping.
January 9, 2014 at 10:18 am #14051Chris,
For some reason, taxonomy maps are working now!
The only thing I’ve changed is the shortcode, no change to theme or plugins.
Anyhow, thanks for holding my hand through this; and consider this resolved.
Til next time I mess things up.January 12, 2014 at 5:26 pm #14063Chris,
Thanks to you the taxonomy listings work great.
Now, what if I want to list by the field “state” in the custom post type?
Entering this in the browser gives results from various states:
http://domain/church/?state=GA(Eventually, I will want to list by both the field “state” and a custom taxonomy.)
January 13, 2014 at 1:40 am #14070Hi,
The syntax for querying by a custom field is different – you need to set ‘meta_key’ and ‘meta_value’.
See the MapPress documentation for some examples, or here for the WordPress codex:
http://codex.wordpress.org/Class_Reference/WP_QueryI think your query will look something like this:
[mashup query="post_type=church&fellowship=rpca&meta_key=state&meta_value=GA"]January 13, 2014 at 2:27 am #14071Thanks, Chris.
Both quick and accurate!
I’d never have figured it out. -
AuthorPosts
- You must be logged in to reply to this topic.
