Giri
Forum Replies Created
-
AuthorPosts
-
Hi James,
Your child theme functions.php file is not writable.
So I installed code snippets plugin and added the following code.
function whoop_event_detail_venue() { ?> <dl> <dt> <?php echo __('Venue:', GEODIRECTORY_FRAMEWORK); ?> </dt> <dd class="eve-dates"> <?php do_action('whoop_event_detail_venue_link'); ?> </dd> </dl> <?php } add_action('whoop_event_detail_after_category', 'whoop_event_detail_venue'); add_action( 'whoop_event_detail_venue_link', 'whoop_geodir_event_display_link_business' ); function whoop_event_listing_venue($view, $post) { if ($view != 'listview') { return; } if ($post->post_type != 'gd_event') { return; } ?> <div> <span> <?php echo __('Venue:', GEODIRECTORY_FRAMEWORK); ?> </span> <?php do_action('whoop_event_listing_venue_link'); ?> </div> <?php } add_action('geodir_after_listing_post_title', 'whoop_event_listing_venue', 0, 2); add_action( 'whoop_event_listing_venue_link', 'whoop_geodir_event_display_link_business' ); function whoop_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' && (geodir_is_page( 'detail' ) || geodir_is_page( 'listing' ))&& 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 = '<a title="' . esc_attr( $linked_post_title ) . '" href="'.$linked_post_url.'">' . wp_sprintf( __( '%s', 'geodirevents' ), $linked_post_title ) . '</a>'; echo apply_filters( 'whoop_geodir_more_info_link_business', $html_link_business, $linked_post_id, $linked_post_url ); } } } }
You have added a Venue part in detail page already. Please remove that part. I have used a hook to add the code.
Thanks.
No, Thats ok.
Have a nice day.
No worries.
Next time add the code only in code snippets.
The reason we asked you to add in code snippets is because supreme is a child theme. At some point you have to update your theme.
So changes will be lost.
To prevent loss stick to code snippets.
Thanks
Ok I found it.
You have added the same code in both functions/functions.php file and functions.php file.
I have no idea how its working without causing fatal error.
I have just removed those code.
Search working now.
Please test and let me know.
Thanks
Yes thats what I thought.
Hi Lance,
If I added the code most likely I would remember especially if it is couple of days back.
So thats not the code I was talking about.
I found some code in your supreme theme’s functions.php file.
Someone has given you the code for some reason. It has something to do with removal of google maps javascript.
Or you might have copied and added it by yourself in functions.php file.
Either from here
or here
https://wpgeodirectory.com/support/topic/speed-addiction/#post-300161
I’m not sure. But this line actually removes the google maps api javascript which is responsible for lat and lon on home page.
wp_dequeue_script( 'geodirectory-googlemap-script' );
You can try adding the map widget. But still it may not work since you have removed the map.js
Why would the search work everywhere but not the front page?
Thats what I explained in my last reply.
Can you tell me who gave you this code? So I can check why.
function _my_dequeue_script() { if ( is_front_page() ) { wp_dequeue_script( 'geodirectory-googlemap-script' ); }} add_action( 'wp_print_scripts', '_my_dequeue_script', 100 );
Thanks James. Give me some time.
I’ll let you know once i’m done.
Thanks
Hi Lance, for the past two hours I was scratching my head.
It seems like you have customized our supreme theme too.
We advised everyone to use code snippets for customization.
Home page is not loading google maps api and google maps api is require to get the latitude and longitude from the zip code you enter in home page.
I have tried commenting out this part.
function _my_dequeue_script() { if ( is_front_page() ) { wp_dequeue_script( 'geodirectory-googlemap-script' ); }} add_action( 'wp_print_scripts', '_my_dequeue_script', 100 );
Google maps api is still not being loaded.
So I guess you removed maps api on home page somewhere else.
I have no idea where you added the code.
Please make the home page to load the google maps api.
That should fix your issue.
Thanks
ok thanks
Ok thanks. Let me check whats wrong.
You see listings right in both pages right? Or its returning “No results”?
Hi James,
can you post your wp admin and ftp details?
Thanks
Sorry Gautam, I don’t do freelancing.
You can try our jobs scection https://wpgeodirectory.com/support/forum/geodirectory-jobs/
If that doesn’t work out, try freelancer.com or upwork.com
Every freelancer has their own rate.
Thanks
You are welcome 🙂
-
AuthorPosts