• Resolved hagentertainment

    (@hagentertainment)


    In a multi-directory setup, is there a way to show all listings by default as opposed to setting a specific directory type? If now, please consider adding this option in a future version.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @hagentertainment,

    Showing listings from All Directory is quite complicated. Because, when showing listings on the All Listings page, the page layout depends on the configuration set on the builder for a specific directory type. So if you were to show listings from, let’s say two, different directories, they’ll use the All Listing layout from two different directories which potentially could result in an ugly page. We do have this feature on our mind and we want to implement it in a more user-friendly way, so it could take some time.

    Anyway, if you really want to show listings from All Directories on your All Listing page, you can use this piece of code, this will show listings from All Directories but one thing is it won’t hide the type navigation. If you want to hide the navigation, you’ll have to edit some template files.

    add_filter("atbdp_all_listings_query_arguments", function($args) {
    	$directory_types = get_terms(array(
    		'taxonomy' => ATBDP_DIRECTORY_TYPE,
    		'fields' => 'ids',
    		'hide_empty' => false,
    	));
    	$args["meta_query"]["directory_type"]["value"] = $directory_types;
    	return $args;
    });

    Regards,
    Mahdi.

    Thread Starter hagentertainment

    (@hagentertainment)

    Thank you, that got me started in the right direction.

    Hi @hagentertainment,

    It’s odd that it didn’t work, I’ve tested it thoroughly before providing it to you. Anyway, glad to know you figured it out. Let me know if there’s anything else I can help you with.

    Regards,
    Mahdi.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Multi-Directory: Show All Listings by Default’ is closed to new replies.