This topic has 14 replies, 4 voices, and was last updated 8 years by rikbutterflyskull.

  • Author
  • #72795
     Parkproductions
    Participant

    Hi wanted to make the map on my listing page fullwidth like on the homepage. Set width to 100% in the widget settings however the container in the template gd uses by default is only 1280px wide for that page.

    Need to know what page template gd is grabbing and if its possible to make adjustments similar to the header shortcode [gd_homepage_map width=100% height=600px maptype=roadmap zoom=1 autozoom=true child_collapse=true scrollwheel=false marker_cluster=1 ]

    on this page http://www.globalsportcoach.com/places/tennis-2/

    to make it look like this page http://www.globalsportcoach.com/facilities/

    #72863
     sharmstr
    Moderator

    Remove the map widget from GD Listing Top Section and add this to your child’s functions.php file.

    COPY CODE
    
    add_action('kleo_before_content','add_map');
    function add_map() {
        if (is_post_type_archive() && in_array(get_post_type(), geodir_get_posttypes())) {
            echo do_shortcode('[gd_homepage_map width=100% height=600px maptype=roadmap zoom=1 autozoom=true  child_collapse=true scrollwheel=false marker_cluster=1]');
        }
    }
    

    Be sure to test all pages. It was a bear trying to figure out how to only add it to the listing page. I dont see that they have a basic function like “if_page(‘listing’)”.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #72942
     Parkproductions
    Participant

    Thanks Sharmstr your a legend! I’m having some unrelated permalink issues though, it shows no results on the listing pages but all the layout and styling is perfect, cheers.

    #72984
     sharmstr
    Moderator

    awesome!

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #73516
     Parkproductions
    Participant

    Hey Sharmstr, I’ve updated to geodirectory 1.5.1 as they made a fix to the permalinks issue however I can’t get the function code snippet you provided to trigger the map properly. It currently is still trying to display inside a non-full-width page template.

    issue on this page http://www.globalsportcoach.com/places/

    #73545
     sharmstr
    Moderator

    The code still works for me with the latest geo update. Did you purge your server cache after the updae. You site is throwing a bunch of 404 errors.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #74012
     Parkproductions
    Participant

    Hi Sharmstr, I’ve got the code snippet to work on a clean install of kleo and wordpress however my live site still isn’t displaying correctly. Screenshots of css elements attached hoping I’ve just missed something basic

    #74013
     Parkproductions
    Participant

    CSS Image

    Attachments:
    You must be logged in to view attached files.
    #74017
     Parkproductions
    Participant

    Resolved the issue, there was a difference in my kleo/page-parts/general-before-wrap.php file

    #75675
     msattolo
    Participant

    Hi Sharmstr and Parkproductions
    I am trying to perform the same but the map it is not showing. I understand you had to change some code in the general-before-wrap.php file. Could you point me where, to see if I can solve it?
    Thank you!
    Miriam

    #75691
     sharmstr
    Moderator

    Hi Miriam,

    Please read the thread again. His issue was that he had a custom general-before-wrap.php, not that he put my code in there. Look at my first response. That’s what you need to do.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #75734
     msattolo
    Participant
    This reply has been set as private.
    #76519
     Parkproductions
    Participant

    Hey Sharmstr, is there a way to use the code provided to also full width the map div on a search result page

    http://www.globalsportcoach.com/?geodir_search=1&stype=gd_place&s=gymnastics&snear=&sgeo_lat=&sgeo_lon=

    That link is currently using the GD Search Top Section > GMAP Homepage widget

    #76598
     sharmstr
    Moderator

    Not sure. Guess you could try adding geodir_is_page(‘search’) to the original function I gave you.

    COPY CODE
    
    add_action('kleo_before_content','add_map');
    function add_map() {
        if (geodir_is_page('search') || is_post_type_archive() && in_array(get_post_type(), geodir_get_posttypes())) {
            echo do_shortcode('[gd_homepage_map width=100% height=600px maptype=roadmap zoom=1 autozoom=true  child_collapse=true scrollwheel=false marker_cluster=1]');
        }
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #100701
     rikbutterflyskull
    Participant

    Hi, i had the same problem today. Solved by the first function

    COPY CODE
    add_action('kleo_before_content','add_map');
    function add_map() {
        if (is_post_type_archive() && in_array(get_post_type(), geodir_get_posttypes())) {
            echo do_shortcode('[gd_listing_map width=100% height=350 scrollwheel=false]');
        }
    }

    replacing the shortcode [gd_homepage_map] only for homepage with [gd_listing_map] for listing page, in according with Geodirectory shortcodes

Viewing 15 posts - 1 through 15 (of 15 total)

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

Log in with your credentials

Forgot your details?