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 6 years, 11 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #381771

    Juan Manuel Furlan
    Expired Member
    Post count: 47

    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

    #381821

    Guust
    Moderator
    Post count: 29970

    To 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

    #381833

    Juan Manuel Furlan
    Expired Member
    Post count: 47

    Hi 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,

    #381892

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    There 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

    #381966

    Juan Manuel Furlan
    Expired Member
    Post count: 47

    Hi 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.

    #382086

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi 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

    #382118

    Paolo
    Site Admin
    Post count: 31206

    Make 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

    #382224

    Juan Manuel Furlan
    Expired Member
    Post count: 47

    Thanks 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

    #382291

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Please provide wp-admin details and we will check.

    Thanks,

    Stiofan

    #382394

    Juan Manuel Furlan
    Expired Member
    Post count: 47
    This reply has been marked as private.
    #382443

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Please check now, i modified the code a bit as u are using a page and not the events category page.

    Stiofan

    #382448

    Juan Manuel Furlan
    Expired Member
    Post count: 47

    Excellent job Stiofan, now is working just great.

    Thank you very much for your help.

    Juan

    #382450

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    You 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-post

    Thanks,

    Stiofan

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket