• Resolved madeindonesia

    (@madeindonesia)


    ALM version: 2.13.1
    WordPress version: 4.7

    Hi @dcooney,

    Thank you very much for this very nice plugin ^^. I almost always use this when needed.
    I found the “Custom Fields (Meta Query)” part of ALM is not working correctly on Taxonomy page. It works on other page (tried to put on home page, and it works!)

    Just small info, i use a taxonomy-vacancy_category.php template on mysite.com/vacancy-category/vacancy-it/ page. There’s no problem on template thing.

    In case you want to re-produce the issue, from the shortcode builder:

    1. Select custom post type
    2. Select the Custom Fields (Meta_Query) part

    Sample of generated shortcode:
    [ajax_load_more post_type="vacancy" meta_key="vacancy_category" meta_value="3" meta_compare="=" meta_type="NUMERIC"]
    Try to put this on taxonomy page.

    This doesn’t work. For meta_compare, IN operator doesn’t work too. Then i tried to use this argument on regular WP_Query (without the plugin) and it works!

    Not sure what causes this. ALM requests to admin-ajax.php, i think it should not be polluted by taxonomy thing :-/. And also ALM returns the postcount as 2. But with empty html.

    Note:
    It’s not “totally not working”, since ALM still returns this response in the Network panel:
    {"html":"","meta":{"postcount":2,"totalposts":2,"debug":false}}

    Thanks,
    Bagus

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter madeindonesia

    (@madeindonesia)

    print_r version of generated of ALM’s arguments:

    Array
    (
        [post_type] => Array
            (
                [0] => vacancy
            )
    
        [posts_per_page] => 5
        [offset] => 0
        [order] => DESC
        [orderby] => date
        [post_status] => publish
        [ignore_sticky_posts] => 
        [paged] => 1
        [meta_query] => Array
            (
                [0] => Array
                    (
                        [key] => vacancy_category
                        [value] => 3
                        [compare] => =
                        [type] => NUMERIC
                    )
    
            )
    
    )
    Thread Starter madeindonesia

    (@madeindonesia)

    Arghh.. the mistake is not on this plugin.
    The mistake is on my code.

    I use $alm_taxonomy = strip_tags(trim($_GET['taxonomy'])); in meta_query request. It should be $_GET['meta_key'] instead.

    Finally, im sorry for this thread 😉
    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘AJAX Load More’s Custom Fields (Meta Query) parameter is not working’ is closed to new replies.