Restricting Search Criteria

This topic contains 15 replies, has 2 voices, and was last updated by  Paolo 8 years, 1 month ago.

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

Open Support Ticket
  • Author
    Posts
  • #263254

    Ed Lynch
    Buyer
    Post count: 56

    Hi,

    As our directory is categories only. How do I (or hopefully possible) to accomplish the following:

    1. Turn off or hide the home page “Search” field. (Supreme Directory)
    2. Also hide the “Near me/Within” field, defaulting to listings in order of distance from users location. (user may adjust in listing view)
    3. Hide or turn off the popular categories display.

    Thank you!

    Ed

    #263317

    Paolo
    Site Admin
    Post count: 31206

    Basically you want to remove everything from the Supreme home featured area, but title and sub-title?

    If I understood correctly you can add this code in GD > design > scripts > custom css:

    
    
    .sd.home .featured-area section, .sd.home .featured-area .geodir-category-list-in {
        display: none;
    }

    Let us know if that is what you wanted.

    Thanks

    #263325

    Ed Lynch
    Buyer
    Post count: 56

    Hi Paolo,

    Nearly, the attached if helps is what I am looking to ultimately achieve.

    1. Remove Search Field
    2. Remove distance field (defaulting to distance set but can be adjusted by user in listing view)
    3. Have category field format to center beside search icon button
    4. Add a button to link to another URL just below.

    Hopefully the image helps. (apologies for the crude mock up)

    Thanks,

    Ed

    #263327

    Ed Lynch
    Buyer
    Post count: 56

    Sorry, also removing popular categories. Basically, replacing popular categories title with the button to link to another URL. (per the mock up)

    Thanks,

    Ed

    #263331

    Paolo
    Site Admin
    Post count: 31206

    In that case you will need:

    
    
    .sd.home .featured-area .ac_input, .sd.home .featured-area .near-compass {
        display: none;
    }

    The only way to add a link below the search form is to edit this function: sd_homepage_featured_content which uses this action:

    sd_homepage_content

    .

    This is how I would do it.

    
    
    // we remove everything from the home page
    remove_action('sd_homepage_content','sd_homepage_featured_content');
    
    // we copy the function sd_homepage_featured_content rename it and edit it
    function my_sd_homepage_featured_content(){
    
                    if (is_singular() && $location = do_shortcode('[gd_current_location_name]')) { ?>
                        <h1 class="entry-title"><?php echo $location; ?></h1>
                    <?php } else { ?>
                        <h1 class="entry-title"><?php the_title(); ?></h1>
                    <?php }
    
                    $sub_title = get_post_meta(get_the_ID(), 'subtitle', true);
    
                    if (geodir_is_page('location') && defined('GEODIRLOCATION_VERSION')) {
                        $loc = geodir_get_current_location_terms();
                        $location_type = geodir_what_is_current_location();
                        $country_slug = '';
                        $region_slug = '';
                        if ($location_type == 'city') {
                            $slug = $loc['gd_city'];
                            $region_slug = $loc['gd_region'];
                            $country_slug = $loc['gd_country'];
    
                        } else if ($location_type == 'region') {
                            $slug = $loc['gd_region'];
                            $country_slug = $loc['gd_country'];
                        } elseif($location_type == 'country') {
                            $slug = $loc['gd_country'];
                            $country_slug = $loc['gd_country'];
                        }
                        else {
                            $slug = '';
    
                        }
                        $seo = geodir_location_seo_by_slug($slug, $location_type, $country_slug, $region_slug);
                        $tagline = (isset($seo->seo_image_tagline)) ? $seo->seo_image_tagline : '';
                        if ($tagline) {
                            $sub_title = stripslashes($tagline);
                        }
    
                    }
                    if (isset($sub_title)) {
                        echo '<div class="entry-subtitle">' . $sub_title . '</div>';
                    }
    
                echo do_shortcode('[gd_advanced_search]');
    // we comment out the popular category shortcode completely.
                //echo do_shortcode('[gd_popular_post_category category_limit=5]');
    // we add the link needed before the chevron
                echo '<a href="YOUR_URL">YOUR_ANCHOR_TEXT</a>';
                echo '<div class="home-more" id="sd-home-scroll"><a href="#sd-home-scroll" ><i class="fa fa-chevron-down"></i></a></div>';
    
    }
    
    // we add everything back on the home page
    add_action('sd_homepage_content','my_sd_homepage_featured_content');

    Remember to change echo ‘YOUR_ANCHOR_TEXT‘; and add your url and anchor text.

    The best way would be to use code snippet plugin to make this changes so that future updates will not wipe them out.https://wordpress.org/plugins/code-snippets/

    Thanks

    #263335

    Ed Lynch
    Buyer
    Post count: 56

    Thanks Paolo,

    I may leave the URL button out as I don’t want to dive to deep into messing with the editor. (basically, beyond my knowledge base)

    The CCS to remove the homepage search fields worked, just a slight formatting issue per the attached. Also, while on topic. Would you also have a CSS script to remove search from the listing view also.

    Nearly there on how we want the directory to perform. Also, taking a moment to say the support from you guys is exceptional, simply second to none. A sincere thank you.

    #263338

    Paolo
    Site Admin
    Post count: 31206

    If you want to remove the 2 fields from every form change the css I’ve given you with this:

    
    
    .ac_input, .near-compass, .sd.home .featured-area .sd.home .featured-area .geodir-category-list-in  {
        display: none;
    }

    For the near me page I’ll need a link, images cannot be inspected.

    Thanks

    p.s. if you are enjoying GD and our support, please consider leaving a nice review here: https://wordpress.org/support/plugin/geodirectory/reviews/

    We would really appreciate it… 🙂

    #263342

    Ed Lynch
    Buyer
    Post count: 56
    This reply has been marked as private.
    #263353

    Paolo
    Site Admin
    Post count: 31206

    My bad, I mixed up the css:

    
    
    .ac_input, .near-compass, ..sd.home .featured-area .geodir-category-list-in  {
        display: none;
    }

    This will work. Let me know when you fixed this so that I check the near me page.

    Thanks

    #263361

    Ed Lynch
    Buyer
    Post count: 56
    This reply has been marked as private.
    #264873

    Ed Lynch
    Buyer
    Post count: 56
    This reply has been marked as private.
    #264989

    Ed Lynch
    Buyer
    Post count: 56
    This reply has been marked as private.
    #265041

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    please create an admin user for me and I will check the CSS part.

    Let me know,

    Thanks

    #265042

    Ed Lynch
    Buyer
    Post count: 56
    This reply has been marked as private.
    #265047

    Ed Lynch
    Buyer
    Post count: 56
    This reply has been marked as private.
Viewing 15 posts - 1 through 15 (of 16 total)

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount