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 TicketTagged: popular categories, Search field
-
AuthorPosts
-
September 9, 2016 at 2:55 pm #263254
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
September 9, 2016 at 4:06 pm #263317Basically 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
September 9, 2016 at 4:21 pm #263325Hi 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
September 9, 2016 at 4:23 pm #263327Sorry, also removing popular categories. Basically, replacing popular categories title with the button to link to another URL. (per the mock up)
Thanks,
Ed
September 9, 2016 at 4:38 pm #263331In 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
September 9, 2016 at 4:56 pm #263335Thanks 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.
September 9, 2016 at 5:01 pm #263338If 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… 🙂
September 9, 2016 at 5:12 pm #263342This reply has been marked as private.September 9, 2016 at 5:37 pm #263353My 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
September 9, 2016 at 6:03 pm #263361This reply has been marked as private.September 12, 2016 at 2:53 pm #264873This reply has been marked as private.September 12, 2016 at 5:52 pm #264989This reply has been marked as private.September 12, 2016 at 6:54 pm #265041Hi,
please create an admin user for me and I will check the CSS part.
Let me know,
Thanks
September 12, 2016 at 6:56 pm #265042This reply has been marked as private.September 12, 2016 at 7:02 pm #265047This reply has been marked as private. -
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket