Mashup shortcode with meta_compare

Home Forums MapPress Support Mashup shortcode with meta_compare

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #18267
    monsieurgraphiste
    Participant

    Hi Chris,

    Thanks for your plugin

    Is it possible to add “&meta_key=annonce_surface&meta_value=100&meta_compare=>=” on a mashup shortcode ?

    Thanks for your help

    #18297
    Chris
    Keymaster

    Hi,

    Yes, that should work fine.  I tried this simple version using a field called ‘aliases’ (I think your field is ‘annonce_surface’) and it worked for me:

    [mashup query="meta_key=aliases&meta_value=482&meta_compare=>="]
    #18307
    monsieurgraphiste
    Participant

    Hi Chris,

    I tried to do this but it doesn’t work for me.

    Here is the complete mashup code :

    <section id=”carte”>[mashup query="post_type=annonce&offre=vente&meta_key=annonce_type&meta_value=appartement&meta_key=annonce_surface&meta_value=100&meta_compare=>=" height="500"]</section><section></section><section>Order is important or not ?</section><section></section><section>Thanks in advance for your help</section>

    #18309
    Chris
    Keymaster

    Hi,

    I think I see the problem: you have two meta_key/meta_values.  That’s not possible in the shortcode (it’s a limitation of the WP query module when using strings).  You can only use one meta.  If possible, convert the non-numeric key to a tag, category, or custom taxonomy instead.

    #18311
    monsieurgraphiste
    Participant

    Hi Chris,

    I found a solution for this,

    Generate the map with PHP using this :

     

    <?php

    $map = new Mappress_Map(array(‘query’ => $args, ‘height’ => 500));
    echo $map->display();

    ?>

     

    Thanks

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