This topic has 7 replies, 2 voices, and was last updated 7 years by Radu.

  • Author
  • #177353
     rlarson87
    Participant

    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.
    #177506
     Radu
    Moderator

    Hi,

    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 CODE
    
    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');
        }
    }
    

    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 solution
    #177582
     rlarson87
    Participant
    This reply has been set as private.
    #177683
     Radu
    Moderator

    Hi,

    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.

    https://irside.com/companies/

    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 solution
    #177726
     rlarson87
    Participant

    Hi, 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.
    #177967
     Radu
    Moderator

    Hi,

    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 CODE
    
    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_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 solution
    #177992
     rlarson87
    Participant

    Thank I will contact GeoDir. Can you explain again what the code does that you provided?

    Thanks

    #178010
     Radu
    Moderator

    Hi 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
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 8 posts - 1 through 8 (of 8 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?