• Resolved BigRJD

    (@bigrjd)


    This is a great plugin, and it’s potentially the plugin I require due to it’s features, however I am running into a couple of issues.

    The following PHP code is what I am am currently using to output my multiple taxonomy terms (or so I intended). The issue is that only the first term in the array is coming out (product-1 list not product-2 list). What am I missing here?

    the_a_z_listing( array(
        'post_type' => 'stores',
        'tax_query' => array(
            array(
                'taxonomy' => 'products-sold',
                'field' => 'slug',
                'terms' => array(
                    'product-1',
                    'product-2'
                ),
            ),
        ),
    ) );
    ?>

    The second issue I have come up against is when I have moved the a-z-listing-multi-column.example.php to the root theme file and renamed it as stated in the documentation I am not getting any results back at all, it’s as though the plugin no longer functions as A – Z letters at the top are no longer showing either.

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

    (@bigrjd)

    I would just like to add, is it possible to add the_a_z_listing to a custom SQL, which calls the database for certain parameters?

    Plugin Author Dani Llewellyn

    (@diddledani)

    Your PHP code looks correct. I’m not sure what would be going wrong with it.

    It is possible to modify the SQL for a posts listing by hooking the available WP_Query injection points, as this plugin uses WP_Query for posts listings. For Taxonomy term listings we use the function from core called get_terms() so if there are any SQL hooks in that then you can inject there, but I don’t know about them.

    If the page is blank, or half-completed then there is likely a fatal error somewhere. Your server logs should reveal a message of what and where the error is.

    Thread Starter BigRJD

    (@bigrjd)

    I am currently finding that when I query out the results I can get both the terms I need, however the moment I wrap the $args within the_a_z_listing() only the first term returns from the array.

    I used the plugin Custom Post Type UI to create the custom posts and taxonomies. Could there be a conflict between the 2 plugins causing the issue?

    Plugin Author Dani Llewellyn

    (@diddledani)

    There shouldn’t be any conflict, but anything’s possible.

    Could you share the full code of your usage of the_a_z_listing() where it doesn’t work, including the full $args array you’re using?

    This is a particularly odd issue, because underneath the plugin uses WP_Query to do the fetching of the posts, so if the same array works in a WP_Query call then it should work as-is with this plugin.

    Thread Starter BigRJD

    (@bigrjd)

    I managed resolve the issues I was having.

    I have the taxonomies set up in a way where a custom post type is using multiple taxonomies and in each of the taxonomies they have several terms associated with it been applied to that post.

    I used the following code to query the two taxonomies needed.

    the_a_z_listing(array(
        'post_type' => 'stores',
        'posts_per_page' => '1',
        'order_by' => 'menu_order',
        'order' => 'ASC',
        'tax_query' => array(
            'relation' => 'AND',
            array(
                'taxonomy' => 'store-business',
                'field'    => 'slug',
                'terms'    => business-slug
            ),
            array(
                'taxonomy' => 'products-sold',
                'field'    => 'slug',
                'terms'    => array('product1-slug', 'product2-slug')
            ),
        ),
    )
    );

    As a side note the issue I had regarding the multi-colomn coming back blank was because I was missing a semicolon somewhere.

    Plugin Author Dani Llewellyn

    (@diddledani)

    I’m glad you got running ??

    I’ll mark this topic as resolved for now, but please come back if I can help further…

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘No output from multiple terms in an array.’ is closed to new replies.