Forum: F.A.Q

This forum is closed for new topics. However, you can still search for a solution in the old topics. For technical support and general questions related to GEO my WP plugin and its core add-ons please use the support forum.

how do display location in post

Forums F.A.Q how do display location in post

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #33853
    chunkymac
    Member

    How can I actually display the location details – (esp website, email & phone details) in the actual post?

    Thanks

    Chris

    #33859

    Hi Chris,
    For now they are being saved in custom fields so you can easily display them by echoing the custom fields:
    _wppl_phone
    _wppl_fax
    _wppl_website
    _wppl_email

    ex echo get_post_meta($post->ID,'_wppl_phone', true);

    I am planing to drop the use of the custom fields in the conning update or the next one just because the same information is also being saved in Support table and it is unnecessary duplication. When i do so i will also create functions to display those fields.

    #33858
    chunkymac
    Member

    Many thanks

    #33857
    eusebius
    Member

    Hello,

    Thank you for an excellent plugin with excellent support.

    I am writing to request that you do not remove support for custom fields if you can avoid it. The reason I ask is because many of us are using this plugin in conjunction with WP Types and Views. If you remove the custom fields, we would lose that flexibility, unless, of course, you provide us with shortcodes to display each piece of info (i.e., street, city, state, telephone, website, etc.)

    Either way, I just wanted to offer my humble opinion.

    God bless

    #33856
    chunkymac
    Member

    That’s how I use it too. In fact for the issue I mentioned above I wound up using a view created with WP-Views which makes it ridiculously easy to display custom fields.

    #33855

    I haven’t got to use WP-view yet so i am not sure how it works.
    But I will definitely provide a functions as well as shortcode( now when you mentioned it) to make it easy to display any of the fields. It will be very simple.
    As i mentioned before, the main reason i want to drop the custom fields is because of the duplicate data in the database as the location’s information is already being saved in places_locator table in database.
    Also performance-wise it is much better to use the places_locator table in order to display any or all of the location fields (address fields and additional info) since it requires only one call to the database and we get all the fields. When calling the location fields using custom fields each custom fields requires a call to the database.
    As well as in the loop, since Gmw_query is joining the wp_posts table together with places_locator table when running a search query all the location fields are already within each post of the loop. So in order to display any of the location fields all you need to do is echo it like:
    $post->address,
    $post->city,
    $post->fax,
    $post->phone
    and so on…
    instead of calling each location field from the database for each post in the loop.

    Dropping the custom fields is not a must but it will save sources in database specially for bigger sites, will be better for performance, and will clean many lines of codes.

    I will definitely provide the right functions and shortcodes to make it easier to use.

    #33854
    David Kenyon
    Member

    I am trying to call post geocoded data into a product description. Example: “This product is made in [US] in the state of [state] in the city of [city] in the zip code of [zip code]. I tried using the PHP echo command as suggested above, but I not getting the field values. Is there a specific table I am supposed to call too. I am not much of a PHP programmer, so excuse me if I need the kindergarten explanation here.

    Thanks, Dave

    #51103
    krm218
    Member

    What’s the updated answer to this post? It’s from 2013 but wondering what the fix is.

    I tried echo get_post_meta($post->ID,’_wppl_phone’, true); but it didn’t work

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

You must be logged in to reply to this topic.