How to use locations properly

This topic contains 13 replies, has 3 voices, and was last updated by  Guust 5 years, 9 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #439741

    Benjamin
    Full Member
    Post count: 67

    Hello again!
    I’ve been informed in a previous thread that I’m going about using this plugin the wrong way.
    I currently have it set up so that I gave each ‘place’ a category for their location, so one may be in the category “USA” and the subcategory “Ohio”
    The reason we did it this way was because we need to be able to click on that category, and lead to a page listing all the sub categories. I didn’t see anyway to do this with locations, but it could be done with the CPT Categories widget.
    I would like to use the locations instead of the categories though, if possible, because I know it will work better and not mess up our slugs and such. Having our navigation like this is very important though, as this is how our site has been for years and we don’t want to change it up too much and confuse our customers.
    I’ll add a private reply with our websites so you can see an example of our navigation system and what we’re trying to replicate.

    #439743

    Benjamin
    Full Member
    Post count: 67
    This reply has been marked as private.
    #439749

    Alex Rollin
    Moderator
    Post count: 27815

    Hello,

    here was one of the topics where your site was discussed previously: https://wpgeodirectory.com/support/topic/filter-search-within-categories-automatically/#post-437629

    is there anyway to achieve that “All Distributors” navigation like on our current site using the locations in geodirectory?

    I think what you want are CPT location pages. Here is an example of such a page from our demo:

    https://wpgeo.directory/supreme-directory/events/united-states/california/san-francisco/

    This page shows all events ‘in’ San Francisco. Then there are pages to show all events in

    https://wpgeo.directory/supreme-directory/events/united-states/california/
    https://wpgeo.directory/supreme-directory/events/united-states/

    These are location pages, and each CPT gets them and they list all the listings in that location.

    I think making links directly to these pages is the way to go, too, and to do it manually if needed, whether you do it as a list of links to states or as a ‘jump list’ hand coded with a dropdown.

    So, you have a choice with GD, to implement ‘swivel’ or ‘strong’ as either

    A) Categories (recommended)
    B) Custom post type (means that they can’t all be shown on a map together, but the posts can have different fields)

    GD is optimized to handle all your listings, but the tradeoff is that the “Popular Locations” widget doesn’t do quite what you want: https://wpgeodirectory.com/docs/location-manager-widgets/#pop

    So handcoding that list may be an option if you really need it.

    #439764

    Benjamin
    Full Member
    Post count: 67

    Thanks for all the advice!
    Unfortunately I have no idea how to go about what you’re suggesting. While I’m well versed in some coding, wordpress is still fairly new to me. I would have to use templates to edit pages like that, right? Is there any way to make it automatically grab the states or areas under the country if I’m on the country’s page? Otherwise I’m not sure how I would edit each individual page to have what I need on it…

    Do you foresee any issues with how I have it set up now, with the categories, though? I may just have to keep it that way if I’m not able to set up the locations how I need.

    Also, is there any way that a widget that shows top level locations will be available in the future? I’m personally surprised it’s not already a feature, especially for bigger directories that would have hundreds of locations displayed in the popular locations widget. As it is now, there’s no widget that lets you click any location other than city level locations. I’m actually not sure how you’re ever supposed to get to any location pages other than city level locations, other than manually linking them.

    #439766

    Alex Rollin
    Moderator
    Post count: 27815

    Near Search field has autocomplete option for locations, so, most people use that, and change the near field placeholder text to give site-specific instruction to users to type in the name of a city/region/country. Like, ‘type in your country’.

    In your case it sounds like you don’t need the “Search for” field, at all and could maybe even hide it with CSS. So, really, you could just have the Near field, with instruction like ‘type in your country’. Then, just add 2 widgets to GD Home, one for listings that are swivel category, one for strong category.

    You can try these things out as you like, because they already work on your site, you just aren’t using them right now.

    To make a link to a location page, the html would be like:

    
    
    
    <a href="https://mysite.com/location/united-states/california/san-francisco/">San Francisco</a>
    <a href="https://mysite.com/events/united-states/california/">California</a>
    <a href="https://mysite.com/events/united-states/">United States</a>
    

    That comes out like:

    San Francisco
    California
    United States

    Elaborated out a bit:

    
    
    
    Countries: <a href="https://mysite.com/events/united-states/">United States</a>
    List of Regions in <a href="https://mysite.com/events/united-states/">United States</a>
     - <a href="https://mysite.com/events/united-states/california/">California</a>
    List of Cities in California
     - <a href="https://mysite.com/location/united-states/california/san-francisco/">San Francisco</a>
    
    

    Countries: United States
    List of Regions in United States
    California
    List of Cities in California
    San Francisco

    A web designer could put that list of links together for you easily and you could put it into a widget, or as you like.

    You can try working with the location switcher, too.
    To list states, you need the Location Switcher in the menu or sidebar.
    https://wpgeodirectory.com/docs/location-manager-shortcodes/#tab
    See an example in the sidebar here: https://2cv.com.au/directory/

    #439847

    Guust
    Moderator
    Post count: 29970

    I also suggest to add these shortcodes to a test page, and you should get directly a better feel for what you have done so far.
    [`gd_advanced_search]
    [gd_login_box]
    [gd_cpt_categories]
    [gd_location_switcher]`

    If you give us WP admin details for your dev site too, then we can give you more pointers.

    #439870

    Benjamin
    Full Member
    Post count: 67
    This reply has been marked as private.
    #439871

    Alex Rollin
    Moderator
    Post count: 27815

    The default text for ‘near’ can be changed at

    GeoDirectory – Design – Search – Near field default value

    #439883

    Guust
    Moderator
    Post count: 29970
    This reply has been marked as private.
    #440435

    Benjamin
    Full Member
    Post count: 67

    Is there any way to get the listings to display as a list on the bottom of those first two pages?

    #440479

    Guust
    Moderator
    Post count: 29970

    Yes, just add the GD Popular Post View widget to the GD Home Content section.

    Widgets: https://wpgeodirectory.com/docs/widgets/#popular-post
    Layout: https://wpgeodirectory.com/docs/layout/#directory
    Demo: https://wpgeo.directory/docs/location/united-states/

    Thanks

    #440590

    Benjamin
    Full Member
    Post count: 67

    Is there any way to make that widget display all of the listings in a section, with pagination, like how the listings on the listings pages does? We can’t just have some results show but not all..

    #440669

    Guust
    Moderator
    Post count: 29970

    Those are location pages, they are like the homepages for a region or city. They are not meant to show all the listings, they are to show off the region or city.

    To see all listings, you need to see the Listings pages.
    This shows the difference between the pages.

    Location example for US: https://wpgeo.directory/docs/location/united-states/
    Listings example for US: https://wpgeo.directory/docs/places/united-states/

    Thanks

    #440671

    Guust
    Moderator
    Post count: 29970
    This reply has been marked as private.
Viewing 14 posts - 1 through 14 (of 14 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket