Move CPT
This topic contains 14 replies, has 3 voices, and was last updated by Giri 7 years, 4 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: advanced search, CPT
-
AuthorPosts
-
June 5, 2017 at 3:54 pm #381755
Is there any way I can move the CPT Listing below the Advanced Search (See image)?
Jay
June 5, 2017 at 7:09 pm #381801Hi,
I’m not sure there is an hook to do that, otherwise you need to modify theme files and that means losing the mod after every update and having to apply it again.
I asked to the developers to let us know,
Thanks
June 6, 2017 at 12:26 am #381836I guess by “hook”, you mean an add on?
This would be a better solution if there is one.June 6, 2017 at 12:00 pm #381896Hi,
By mean “Hook”, paolo meant the snippet.
Please use code snippets plugin to add the following snippet.https://wordpress.org/plugins/code-snippets/
remove_action('sd_homepage_content','sd_homepage_featured_content'); function sd_homepage_featured_content_modified() { if (is_singular() && geodir_is_page('location') && $location = sd_gd_current_location_name() ) { ?> <h1 class="entry-title"><?php echo esc_attr(__($location, 'geodirectory')); ?></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 = 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(); echo do_shortcode('[gd_cpt_listings cpt_img_width=120 cpt_img_height=90]'); 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','sd_homepage_featured_content_modified');
Thanks
PS: Make sure to activate the snippet.
June 14, 2017 at 10:28 am #383127Hi Giri,
Thank you for that snippet which worked to quite an extent. And I appreciate some modifications are required but if I try to comment out even the slightest then the whole snippet is removed.
Please the attached screenshot without any mods.
You will note the search box, entry title etc are duplicated. Also, the CPT listing is duplicated but keeps the Event CPT which I have excluded.
Appreciate your help.
JayJune 14, 2017 at 10:31 am #383130This reply has been marked as private.June 14, 2017 at 10:31 am #383131Hi Jay,
To hide those duplicated content, you need to use CSS.
Give me the link to the page where you took that screenshot.
Thanks
June 14, 2017 at 10:42 am #383136Hi Giri,
the home page – sorry missed this.
Thanks for prompt response.
JayJune 14, 2017 at 11:00 am #383143This reply has been marked as private.June 14, 2017 at 11:23 am #383149Almost Giri,
The CPT icons to be below the Search box but without the “Events” CPT (Same as in the Home Top Section). I will remove the this top Section GD CPT listing once the snippet is designed.
The “GD Listing” title to be removed/hidden.
I presume this is all in CSS and this will not be lost on upgrades?
JayJune 14, 2017 at 11:41 am #383154Hi Jay,
I have modified the snippet.
CPT grids now get displayed below search form.
But for some reason the css changes not reflecting in front end. Make sure you are not using any cache plugin.
Thanks
June 14, 2017 at 2:34 pm #383205I am not using any Cache Plugin.
I am not sure what I should be looking for. The CSS in the Script Tab is hiding the “Entry-Title” and the “Category List” correctly.
I had previously inserted Additional CSS in the “supreme Directory” for the entry-title and the subtitle. Should I have put this in the GeoDirectory>Design>Script? So that the Titles goes with any other theme?The 2 improvements required:
1. Events CPT not show.
2. GD Listing label not to show.Thanking U
JayJune 15, 2017 at 11:09 am #383354Hi Jay,
I added this code in custom css. It works fine now.
.header-wrap .geodir_cpt_listings h3.widget-title { display: none !important; } .header-wrap .geodir_cpt_listings .gd-cpt-wrow-gd_event { display: none !important; }
June 19, 2017 at 1:36 pm #383861Thanks Giri. This is resolved but see the Cache issue which you commented
“But for some reason the css changes not reflecting in front end. Make sure you are not using any cache plugin.”
I not using any cache plugin but the only way I am able to refresh the front page correctly is by temporarily selecting a different template before selecting the Supreme Dir Template again. Any permanent solution.
JayJune 19, 2017 at 1:38 pm #383881Hi Jay,
If you are not using any cache plugin, but face those issues then the problem is with your hosting provider. Contact your hosting support.
Thanks
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket