How to customize Event Cards / Show Date Filed in listings
This topic contains 12 replies, has 4 voices, and was last updated by Stiofan O’Connor 7 years, 10 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
June 5, 2017 at 5:07 pm #381771
Hi,
GD is just working great for us, everyday we’re trying to explore new functionalities to make it more friendly to our customers.
In this occasion we’d like to know if there’s an easy way to:
– In Event Cards, display the site name where the event is taking place, additionally to picture, event name, date and hours, etc.
– Second, right now customers can’t see the field e-mail displayed among with other listing information. How can we make date field available in listings when it’s present.Thanks,
Juan
June 5, 2017 at 9:25 pm #381821To connect an event to a place listing, review https://wpgeodirectory.com/docs/linking-events-to-places/
That should do exactly what you are asking I think.Emails themselves should not be displayed, or the spammers will take advantage of them.
That is why GD adds an “Enquiry” link to the sidebar if an email is present in the data for the listing.
For example see the sidebar here: https://wpgeo.directory/starter/places/united-states/pennsylvania/philadelphia/restaurants/buddakan/
Look for “send enquiry”.Thanks
June 5, 2017 at 11:20 pm #381833Hi Guust,
Actually events are already linked to the their related places.
Please see the attached file for more details about what we’re trying to achieve.Thanks,
June 6, 2017 at 11:47 am #381892There is currently no way to do that by default, this code snippet should add it where you want though
add_action('geodir_after_listing_post_title','_my_custom_geodir_event_display_link_business'); function _my_custom_geodir_event_display_link_business() { global $post; $post_type = geodir_get_current_posttype(); $all_postypes = geodir_get_posttypes(); if ( !empty( $post ) && $post_type == 'gd_event' && isset( $post->geodir_link_business ) && !empty( $post->geodir_link_business ) ) { $linked_post_id = $post->geodir_link_business; $linked_post_info = get_post($linked_post_id); if( !empty( $linked_post_info ) ) { $linked_post_type_info = in_array( $linked_post_info->post_type, $all_postypes ) ? geodir_get_posttype_info( $linked_post_info->post_type ) : array(); if( !empty( $linked_post_type_info ) ) { $linked_post_title = !empty( $linked_post_info->post_title ) ? $linked_post_info->post_title : __( 'Listing', 'geodirevents' ); $linked_post_url = get_permalink($linked_post_id); $html_link_business = '<div class="geodir_more_info geodir_more_info_even geodir_link_business"><span class="geodir-i-website"><i class="fa fa-link"></i> <a title="' . esc_attr( $linked_post_title ) . '" href="'.$linked_post_url.'">' . wp_sprintf( __( 'Go to: %s', 'geodirevents' ), $linked_post_title ) . '</a></span></div>'; echo apply_filters( 'geodir_more_info_link_business', $html_link_business, $linked_post_id, $linked_post_url ); } } } }
Stiofan
June 6, 2017 at 6:02 pm #381966Hi Stiofan,
I tried adding the suggested code with ‘Code snippet’, unfortunately the whole site broke down (I have already restored it successfully), maybe you could see better what could caused it.
Thanks.
June 7, 2017 at 12:57 pm #382086Hi Juan,
That code works for me.
FYI if u ever have any problems with code snippets u can just remove the plugin fiels via ftp and u dont have to restore anything.Stiofan
June 7, 2017 at 3:16 pm #382118Make sure you are adding it exactly as Stiofan pasted it there. Sometimes while copying and pasting you get straight quotes (‘) turning into curly quotes (‘).
Let us know,
Thanks
June 7, 2017 at 10:08 pm #382224Thanks Stiofan for the advice.
Paolo you were right about pasting the wrong code to the snippet. Now I think is running well, but I can’t see the place name yet among the rest of the event information. Any other idea of what may be happening?
Thanks,
Juan
June 8, 2017 at 11:18 am #382291Please provide wp-admin details and we will check.
Thanks,
Stiofan
June 8, 2017 at 8:26 pm #382394This reply has been marked as private.June 9, 2017 at 11:03 am #382443Please check now, i modified the code a bit as u are using a page and not the events category page.
Stiofan
June 9, 2017 at 11:55 am #382448Excellent job Stiofan, now is working just great.
Thank you very much for your help.
Juan
June 9, 2017 at 12:13 pm #382450You are welcome, feel free to leave us a review if you have not already, it helps us grow! 🙂
https://wordpress.org/support/plugin/geodirectory/reviews/?rate=5#new-postThanks,
Stiofan
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket