Search fields

This topic contains 2 replies, has 2 voices, and was last updated by  Joy 6 years, 1 month ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #428722

    Joy
    Buyer
    Post count: 1076

    Hello, I found this post that provides a snippet to rearrange part of the fields in the search bar.

    https://wpgeodirectory.com/support/topic/change-order-of-fields-in-search-bar/#post-354421

    How would I order it this way:
    keyword (text search)
    category (cpt type)
    location

    Thank you.

    #428743

    Kiran
    Moderator
    Post count: 7069

    Hi Joy,

    Try this snippet.

    
    
    function _gd_custom_reorder_search_inputs( $template ) {
    	remove_action( 'geodir_search_form_inputs', 'geodir_search_form_post_type_input', 10 );
    	remove_action( 'geodir_search_form_inputs', 'geodir_search_form_search_input', 20 );
    
    	add_action( 'geodir_search_form_inputs', 'geodir_search_form_post_type_input', 20 );
    	add_action( 'geodir_search_form_inputs', 'geodir_search_form_search_input', 10 );
    
    	return $template;
    }
    add_filter( 'template_include', '_gd_custom_reorder_search_inputs', 100, 1 );

    Thanks,
    Kiran

    #428885

    Joy
    Buyer
    Post count: 1076

    Awesome Kiran. Thank you so much, I appreciate it.

Viewing 3 posts - 1 through 3 (of 3 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket