Geodirectory Looper Question

Hi, I am working on a client’s site that uses Geodirectory to compile Member and Events information. According to their documentation it is possible to output that information using meta keys (see the yellow notice at the top):

I am wondering if there is a way to do something similar to this post but with the Geodirectory meta keys in the Query String:

My end goal is to use the meta keys to create a Post Looper that shows all the Events that are upcoming and orders them by the start date for the event.

Thanks for your help in advance!!

Hello @coverberg,

Thanks for writing in! I would highly suggest that you identify first what are the post meta or custom fields. You can use the JSM Show Post Metadata. When you edit a particular event, it should display all the metadata and you can use it to find out the exact metadata name or custom fields and the values.

Best Regards.

Thank you for the recommendation. I installed plugin and it isn’t showing any of the Geodirectory fields. Does this mean there isn’t a way to output the Geodirectory meta keys into a Query String?

Hey @coverberg,

Please provide us with your WP Access so that we can check the item and the fields. We would love to figure out how or if it is possible to use loopers. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Best Regards.

Ok here you go. Thank you!

Hey @coverberg,

You can use the dynamic content post meta {{dc:post:meta key="geodir_name"}} for example, {{dc:post:meta key="geodir_street"}} to display the Event information.

Hope this helps.

1 Like

So this partially helps. The post meta you suggested does work. However when I try to adjust it for an event it doesn’t show anything or has random data. For example - {{dc:post:meta key=“geodir_event_start_date”}} or {{dc:post:meta key=“geodir_event_dates”}}

Hello @coverberg,

I would recommend that you contact the creators of the plugin and ask them for further assistance. We seek to know how we can get the event dates since the get_post_meta( $post_id, "geodir_event_dates" ); does not return anything.

Please let us know how it goes.

I heard back from the plugin author and they suggested this (not sure how to implement on my site, sorry):

global $gd_post;
$event_details = maybe_unserialize($gd_post->event_dates);
if( !empty( $event_details[‘start_date’] ) && !empty( $event_details[‘end_date’] )){
$start_date = $event_details[‘start_date’] .’ ‘.$event_details[‘start_time’];
$end_date = $event_details[‘end_date’] .’ '.$event_details[‘end_time’];
$event_start_date = date(‘Ymd\THi00’, strtotime( $start_date )); // Start Date.
$event_end_date = date(‘Ymd\THi00’, strtotime( $end_date )); // End Date.
}

Hi @coverberg,

Although we don’t offer any support to the custom code or any 3rd party code, still, you can still add this to the functions.php of your Child Theme. Please remember that this is a 3rd Party code and we don’t have any control over it. If that does not work, please contact the plugin author.

Thanks