Popular Categories Homepage
This topic contains 14 replies, has 3 voices, and was last updated by Stiofan O’Connor 7 years, 2 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
February 8, 2018 at 3:24 pm #416715
I am using the supreme directory theme and I want to display 2 buttons on the homepage where the popular categories is underneath the search bar. However I am have difficulty locating the necessary php file. I looked at a previous question from https://wpgeodirectory.com/support/topic/popular-categories-supreme-theme/. Have you made changes to the content.php since then
February 9, 2018 at 7:08 am #416836Hello,
You can try inc/geodirectory-compatibility.php
We recommend you not make changes to the theme because they will be overwritten on update.
Why not try a text widget on the home and add your HTML there?
February 9, 2018 at 12:01 pm #416888Hi Alex, thank you but I don’t think I can put a widget into the area that I am looking at putting a button into. Is where the popular categories is underneath the search bar in the supreme theme. I could be wrong but the only way to achieve this would be to edit the core files
February 9, 2018 at 3:26 pm #416906I think you might be right. Let me flag this for the developers in case they have a different idea about it.
February 9, 2018 at 11:04 pm #416977Thanks very much Alex
February 12, 2018 at 11:16 am #417195Hello,
I am not sure exactly what you are trying to do but you can use hooks like:
add_action('sd_homepage_content','_my_new_homepage_content'); function _my_new_homepage_content(){ echo "this is new!"; }
Thanks,
Stiofan
February 14, 2018 at 10:21 am #417534Hi Stiofan, thank you for your response however I was looking a putting a button underneath the search bar. Is there any hooks that can achieve this without having to modify the core files.
February 14, 2018 at 12:43 pm #417556there is no filter in between those, not unless u remove and then add back the entire filter.
Stiofan
February 14, 2018 at 12:52 pm #417558I’m not sure if I explained myself very well. I was hoping to replace the popular categories under the search bar with a button. Is this possible without having to remove the filter and adding it back as I am not sure how that would be done
February 14, 2018 at 1:00 pm #417560No that is not possible you would need to remove it and add it back something like this
add_action( 'after_setup_theme', '_my_remove_theme_actions' ); function _my_remove_theme_actions(){ remove_action('sd_homepage_content','sd_homepage_featured_content'); } function _my_sd_homepage_featured_content() { if (is_singular() && geodir_is_page('location') && $location = sd_gd_current_location_name() ) { echo '<h1 class="entry-title">'. esc_attr(__($location, 'geodirectory')).'</h1>'; } else { echo '<h1 class="entry-title">'. get_the_title() .'</h1>'; } $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 = isset($loc['gd_region']) ? $loc['gd_region'] : ''; $country_slug = isset($loc['gd_country']) ? $loc['gd_country'] : ''; } else if ($location_type == 'region') { $slug = $loc['gd_region']; $country_slug = isset($loc['gd_country']) ? $loc['gd_country'] : ''; } elseif($location_type == 'country') { $slug = $loc['gd_country']; $country_slug = isset($loc['gd_country']) ? $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, 'geodirlocation') : ''; if ($tagline) { $sub_title = stripslashes($tagline); } } if (isset($sub_title)) { echo '<div class="entry-subtitle">' . $sub_title . '</div>'; } sd_search_form_shortcode(); // removed echo do_shortcode('[gd_popular_post_category category_limit=5 category_restrict=1]'); echo "MY NEW BUTTON CAN GO HERE"; echo '<div class="home-more" id="sd-home-scroll"><a href="#sd-home-scroll" ><i class="fa fa-chevron-down"></i></a></div>'; } add_action('sd_homepage_content','_my_sd_homepage_featured_content');
Stiofan
February 14, 2018 at 2:49 pm #417574This reply has been marked as private.February 14, 2018 at 5:01 pm #417598Please also provide FTP details and let me know where u tried to add the code?
Thanks,
Stiofan
February 14, 2018 at 5:23 pm #417607This reply has been marked as private.February 14, 2018 at 5:28 pm #417610Sorry forgot to say I added the code to code snippets
And saved it with the name new .February 14, 2018 at 5:47 pm #417611Thanks for the info.
I have fixed it now and updated the code above/
Stiofan
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket