• Resolved bahnsawy

    (@bahnsawy)


    I want to show only the parent categories.

    [directorist_search_listing filter_text=”no”]

    would you please help

    • This topic was modified 1 year, 8 months ago by bahnsawy.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter bahnsawy

    (@bahnsawy)

    I did enable “Hide Empty Categories” from Settings>Listings>Location & Category

    But it still showing the empty categories in the search form?!

    Plugin Support Mahfuzul Alam

    (@mahfuz87)

    Hi

    Thank you for reaching out.

    Please use the following code at the end of your functions.php file of the correctly activated Child theme.
    If you do not have any child theme installed, please install one.
    You can also use the Code Snippet plugin to implement this code.

    add_filter('atbdp_search_listing_category_argument', function ($args) {
    	$args['hide_empty'] = true; // Empty Categories will be hidden
    	if($args['parent']>0) $args['slug'] = 'donotshow'; // Only parent categories will show
    	return $args;
    });

    Please let me know if you need further assistance.
    Thank you for your cooperation.

    Best Regards

    Thread Starter bahnsawy

    (@bahnsawy)

    Thank you so much Mahfuzl,

    I want to redirect the user to custom page when he send a successful quote I did try this

    if ( $data[‘error’] === 0 ) {

                    $data[‘message’] = __( ‘Your message sent successfully.’, ‘directorist’ );

                        // Redirect the user to a success page or show a success message

                        wp_redirect(‘https://localhost/lawyersorted/booking-confirmation-cta/’);

                        // exit;

                }

    but it’s not working

    would you please help

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Show parent categories in the search form’ is closed to new replies.