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?
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?
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.
I’m glad you got running 🙂
I’ll mark this topic as resolved for now, but please come back if I can help further…