Custom Fields
Re-Envisioned
Support Meta Box Geolocation Possible to get isolated address items for frontend display?

  • Creator
    Topic
  • #9596
    Resolved Memaddog
    Participant

    I am using the “Map” field with accompanying “text” field to for the address. The documentation shows how to display the map and echo the latitude, longitude, and zoom level, but it is possible to grab the “city” for example? Since the address text field is a single string of text, there doesn’t seem to be a way to echo it on the frontend with included line breaks for formatting. Is this possible or do I need separate text fields to enter the address information separately for display on the frontend?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #9597
    Anh Tran
    Keymaster

    Hello,

    The address field is just a text field. While it’s used to auto-suggest the map location, it acts like a normal text field. So you can just use the helper function to get its value and output it in the frontend.

    #11197
    ed@gocloudnine.net
    Participant

    Is it possible to do this using a shortcode? Like, to display just the city for example?

    #11217
    Anh Tran
    Keymaster

    Yes, the city is just a text field and you can use [rwmb_meta] shortcode to show it:

    [rwmb_meta meta_key="city"]

    For details, please see the documentation.

    #11292
    ed@gocloudnine.net
    Participant

    I meant if we use a single field for the auto-suggest, can the result be divided into separate parts, such as City?

    #11297
    Anh Tran
    Keymaster

    Hi,

    You need to create a new text field, and bind it to the city data. Please follow the documentation to know how to do that.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.