How do you output just the zip code?

Home Forums Calendar Products Events Calendar PRO How do you output just the zip code?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #20774
    Tony
    Participant

    I need to output just the zipcode on the listview and widget.
    have tried ‘echo tribe_get_zip( $postId )’ but it doesn’t work.
    Thanks.

    #20791
    Jonah
    Participant

    Hi Tony,

    Instead of $postId try get_the_ID() or just leave it blank. Let me know whether or not that works and maybe post some code next time? We don’t have good code pasting abilities here but pastie.org / pastebin.com or gist.github.com are good options.

    Thanks,
    Jonah

    #20809
    Tony
    Participant

    Jonah, thanks, “get_the_ID()” works.
    Just a follow up, I am trying to replace zip/postcode with an area, for example postcodes beginning with “SW” become “south west” and postcodes beginning with “N” are “north”.

    using the get_the_ID() I’ve come up with this: https://gist.github.com/2951455
    For some reason it’s not outputting anything though. Any idea what might be wrong with it?

    #20912
    Jonah
    Participant

    Hi Tony,

    I’m no PHP expert but $postcode is not an array so I don’t think you can reference $postcode[‘id’] like that. $postcode is just a plain variable and you are assigning it the value of tribe_get_zip() so it’s just going to be the zip code, not an array. Does that help?

    – Jonah

    #977131
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘How do you output just the zip code?’ is closed to new replies.