• CAD

    (@carlos1984)


    Hi!

    I’ve googled and tried different solutions to get this right. Hopefully someone can point me to right direction for this.

    So, what I want to do is to create posts with a custom post type I created, for ex locations. In the page where all the posts is listed I want every post to show the distance from the users location to that posts location on the card. Then inside every post I have the normal advanced custom field google map coordinates.
    And for the store locator as it is now it shows all my stores on the map but they are not connected to my posts. What if I want to have a box on every marker with a link to the right post with the right ID.

    Short description:
    1. In the list of posts hos can I get the distance appear here? Like in the store there’s in the list displayed the distance from the users location.

    2. How to connect stores in the plugin store and map to my posts.

    I’ve looked in the documentation and tried to create a page template from example code in the docs(https://wpstorelocator.co/document/create-custom-store-page-template/) but because this is outside the store I get an error: “If you use the [wpsl_map] shortcode outside a store page, then you need to set the ID or category attribute.” I dont understand how to that. That would be great if I could at least make that work to see my custom template in action.

    Thankful for all hints or directions.

    • This topic was modified 3 years, 4 months ago by CAD.
    • This topic was modified 3 years, 4 months ago by CAD.
Viewing 1 replies (of 1 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    I don’t understand how to that. That would be great if I could at least make that work to see my custom template in action.

    If you categorize your locations, then you can do [wpsl_map category=”x”] where x is the category name. Or use the id of the individual locations.

    You can find the id of the locations by opening one in the admin area, and then look for post=x, where x is the id you need to use in the shortcode.

Viewing 1 replies (of 1 total)
  • The topic ‘Create CPT connected to stores’ is closed to new replies.