Mashup with Taxonomy

Home Forums MapPress Support Mashup with Taxonomy

Tagged: ,

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #14048
    bfeather
    Participant

    [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.

    #14049
    Chris
    Keymaster

    Hi,

    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 = rpca

    If 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);
    ?>
    #14050
    bfeather
    Participant

    Chris,

    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.

    #14051
    bfeather
    Participant

    Chris,

    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.

    #14063
    bfeather
    Participant

    Chris,

    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.)

    #14070
    Chris
    Keymaster

    Hi,

    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_Query

    I think your query will look something like this:

    [mashup query="post_type=church&fellowship=rpca&meta_key=state&meta_value=GA"]

    #14071
    bfeather
    Participant

    Thanks, Chris.
    Both quick and accurate!
    I’d never have figured it out.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.