Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 1 of 1
  1. #1
    Member lew1s's Avatar
    Join Date
    Oct 2013
    Posts
    65
    Member #
    37371
    Liked
    2 times

    new taxonomy in search

    Hi using wordpress properties search plugin. I have two categories (taxonomies). In the search box is set up just one. How can I add another one ? here is my search php code. I need to just create new taxonomy "features". Taxnomy "listing_type" is already there.


    PHP Code:
    <?php 
    function ar_taxonomy_dropdown$taxonomy ) {
                    
    $terms get_terms$taxonomy );
                    if ( 
    $terms ) {
                        
    $return '<div class="searchItem"><span class="white-shadow">Property Type:</span> <select name="meta_tax" class="input-box">'.$taxonomy;
                            
    $return .= '<option value=""> Any </option>';
                        foreach(
    $terms as $term) {
                            
    $return .= '<option value="'.$term->slug.'">'.$term->name.'</option>';
                        }
                        
    $return .= '</select></div>';
                        }
                        return 
    $return;
                    } 





    function 
    ar_search($return false) { 
    include (
    'style-search-box.php');
    $output '
    <div class="ar-search-span"> SEARCH </div>
    <div class="ar-search-box">
            <form method="get" id="searchform" action="'
    esc_urlhome_url() ).'">
            
                <div class="searchItem">
                
                
                    
                        
                
                </div>'
    ;
                  
                    
    $output .= ar_taxonomy_dropdown('listing_type');
                    
                    
              
    $output .= '



              
               
              
              
                
                <input type="hidden" name="post_type" value="listing" />                        
                <input type="submit" class="white-shadow" name="submit" id="ar-submit" value="Search" />
              
              
        </form>
        </div>'
    ;
        if (
    $return === true) {
            return 
    $output;
        } else {
            echo 
    $output;
        }
    }

  2.  


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Tags for this Thread

All times are GMT -6. The time now is 05:15 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com