-
Author
-
October 22, 2017 at 06:25 #177353rlarson87Participant
Hi, on the “All Companies” page, I would like to do the following:
1. Make map full width
2. Show all the companies (like on the homepage) instead of showing page-by-page results
3. Add sorting abilities by Category
Attachments:
You must be logged in to view attached files.October 23, 2017 at 16:08 #177506RaduModeratorHi,
I’m unable to login to your dashboard.
1. I saw that the company page it’s generated dynamically by the GeoDirectory and there is no backend for the page for that the map should be added programatically there wiht the next code
COPY CODEadd_action('kleo_before_content', 'inject_GD_map_before_content_on_related_types', 10); function inject_GD_map_before_content_on_related_types() { if( 'gd_companies' == get_post_type() ) { echo do_shortcode('[gd_homepage_map post_type="gd_companies" width=100% height=500px maptype=roadmap zoom=11 autozoom=true child_collapse=true scrollwheel=true marker_cluster=1 ]'); kleo_switch_layout('right'); } }
The function needs to be pasted in wp-content/themes/kleo-child/functions.php
NOTE : Child theme needs to be installed and activated.
2. Provide credentials to take a look to see if it’s possible since geoDir not haves a place where you can manage the layout for the custom post types of geodir
3. Provide credentials.
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionOctober 24, 2017 at 17:28 #177683RaduModeratorHi,
I’ve added the code into functions and now the map it’s displayed full width, but you should ask the GeoDir team about how you can edit the page layout like on general directory or like on listing layout.
Also in widgets area there is no specific area for your new created GD CPT neither on the geo-directory settings.
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionOctober 24, 2017 at 20:29 #177726rlarson87ParticipantHi, this code is not what I was looking for. I don’t want to add a second map, I just want to make the original map on the Companies page be full screen. See the attachment which is for the Events page, but the same comments apply for the Companies page. Please let me know how to change this code so the original map is full screen.
function change_layout_on_search() {
if(is_search()) {
kleo_switch_layout(‘full’);
}
}add_action(‘kleo_before_content’, ‘inject_GD_map_before_content_on_related_types’, 10);
function inject_GD_map_before_content_on_related_types() {
if( ‘gd_companies’ == get_post_type() ) {
echo do_shortcode(‘[gd_homepage_map post_type=”gd_companies” width=100% height=500px maptype=roadmap zoom=11 autozoom=true child_collapse=true scrollwheel=true marker_cluster=1 ]’);
kleo_switch_layout(‘right’);
}
}Attachments:
You must be logged in to view attached files.October 26, 2017 at 15:29 #177967RaduModeratorHi,
To can have the map edge to edge full width you will have to add the map in the way the code it’s add it.
The GeoDir adds’ that in the page but it’s inner page, so that’s i’ve provided to you that snippet, to can have the map like in the main directory layout.
So you will have to ask the geoDir team about how you can remove the map from the default pace wher the geodir adds for each directory post type.
and the to add the map from code full width for your site cpt
So my next code will check if the displayed page it’s a geodir cpt and will render the map for every cpt
COPY CODEadd_action('kleo_before_content', 'inject_GD_map_before_content_on_related_types', 10); function inject_GD_map_before_content_on_related_types() { if( 'gd_event' == get_post_type() ) { echo do_shortcode('[gd_homepage_map post_type="gd_event" width=100% height=500px maptype=roadmap zoom=11 autozoom=true child_collapse=true scrollwheel=true marker_cluster=1 ]'); kleo_switch_layout('right'); } if( 'gd_meetings' == get_post_type() ) { echo do_shortcode('[gd_homepage_map post_type="gd_meetings" width=100% height=500px maptype=roadmap zoom=11 autozoom=true child_collapse=true scrollwheel=true marker_cluster=1 ]'); kleo_switch_layout('right'); } if( 'gd_place' == get_post_type() ) { echo do_shortcode('[gd_homepage_map post_type="gd_place" width=100% height=500px maptype=roadmap zoom=11 autozoom=true child_collapse=true scrollwheel=true marker_cluster=1 ]'); kleo_switch_layout('right'); } if( 'gd_companies' == get_post_type() ) { echo do_shortcode('[gd_homepage_map post_type="gd_companies" width=100% height=500px maptype=roadmap zoom=11 autozoom=true child_collapse=true scrollwheel=true marker_cluster=1 ]'); kleo_switch_layout('right'); } }
So, you will have to remove the map from the initial position, ask the geo dir how you can do that, since it’s more related to their product not to KLEO
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionOctober 26, 2017 at 18:15 #177992rlarson87ParticipantThank I will contact GeoDir. Can you explain again what the code does that you provided?
Thanks
October 26, 2017 at 19:21 #178010RaduModeratorHi again,
No problem, yes my code adds the map (run and execute the geidir map shortcode ) immediately after header outside the container of the main section of the site in other works that code makes the map full width edge to egde.
Cheers
RHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.