• Resolved downfast

    (@downfast)


    Example:

    meta_key="country, year" meta_value="Australia, _1600"

    Is it possible to load all post related to “Australia” AND “_1600” ?

    So multiple meta_keys AND multiple meta_values, both related to each other.

    Literally to tell it Load me ALL posts in Australia with date 1600. These 2 values comes from custom fields

    • This topic was modified 8 years, 4 months ago by downfast.
    • This topic was modified 8 years, 4 months ago by downfast.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter downfast

    (@downfast)

    p.s. The values comes from 2 different advanced custom fields:

    year
    country

    And the post must be related with the 2 fields, if the post doesn’t match, it shouldn’t appear.

    	function panelShow(e) {
                    var date = <?php the_field("year"); ?>
                    var date = <?php the_field("country"); ?>
    		jQuery(".panel_block").show();
    		if (jQuery(".panel_block:not(:empty)").length) {
    			jQuery("#ajax-load-more ul").attr("data-meta-key", loc + ", " + date);
    		}
    		setTimeout(
      			function() {
        				jQuery.fn.almTriggerClick();
      		}, 1000);
    		
    	}
    <div class="panel_block">
    	<?php echo do_shortcode('[ajax_load_more pause="true" meta_key="country, year" meta_value="value1, value2" post_type="post"]'); ?>
    </div>
    • This reply was modified 8 years, 4 months ago by downfast.
    • This reply was modified 8 years, 4 months ago by downfast.
    Plugin Author Darren Cooney

    (@dcooney)

    Hi @downfast,
    Yes, you can do this.

    Have you tried building your shortcode using the Shortcode Builder? You can add multiple tax queries and you can see how the shortcode should put together.

    meta_key=”country:year” meta_value=”Australia:_1600″ meta_relation=”AND”

    Thread Starter downfast

    (@downfast)

    Hey Darren
    actually I did look into it but id din’t see the button “add another”. Maybe some docs or some help text within the shortcode builder.
    Or maybe was just me, HI honestly missed it.

    Thanks a lot

    Thread Starter downfast

    (@downfast)

    p.s. it also adds:

    meta_compare="IN:IN" meta_type="CHAR:CHAR"

    Is it that ok if I am simply asking for text values to retunr?

    Plugin Author Darren Cooney

    (@dcooney)

    Ok great!
    CHAR is the default and is likely good for what you would need.

    Cheers,

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Is it possible to make a call for multiple meta_keys AND meta_values?’ is closed to new replies.