Kiran
Forum Replies Created
-
AuthorPosts
-
Hi Will,
I have added following PHP snippets to achieve what you asking about.
/** * Order by nearest occurrence schedule for single event. */ function gd_snippet_191212_filter_widget_listings_orderby( $orderby, $table, $post_type ) { global $gd_query_args_widgets; if ( ! empty( $orderby ) && ! empty( $gd_query_args_widgets['single_event'] ) && ! empty( $gd_query_args_widgets['order_by'] ) && GeoDir_Post_types::supports( $post_type, 'events' ) ) { $min_max = $gd_query_args_widgets['order_by'] == 'event_dates_desc' ? 'MAX' : 'MIN'; $orderby = str_replace( GEODIR_EVENT_SCHEDULES_TABLE . '.start_date ', $min_max . '( ' . GEODIR_EVENT_SCHEDULES_TABLE . '.start_date ) ', $orderby ); $orderby = str_replace( GEODIR_EVENT_SCHEDULES_TABLE . '.start_time ', $min_max . '( ' . GEODIR_EVENT_SCHEDULES_TABLE . '.start_time ) ', $orderby ); } return $orderby; } add_filter( 'geodir_filter_widget_listings_orderby', 'gd_snippet_191212_filter_widget_listings_orderby', 20, 3 ); function gd_snippet_191212_filter_widget_listings_fields( $fields, $table, $post_type ) { global $gd_query_args_widgets; if ( ! empty( $fields ) && ! empty( $gd_query_args_widgets['single_event'] ) && GeoDir_Post_types::supports( $post_type, 'events' ) ) { $fields = str_replace( ", " . GEODIR_EVENT_SCHEDULES_TABLE . ".*", "", $fields ); } return $fields; } add_filter( 'geodir_filter_widget_listings_fields', 'gd_snippet_191212_filter_widget_listings_fields', 20, 3 );
Please check and let us know.
Best Regards,
KiranDecember 12, 2019 at 6:35 am in reply to: Currently Using Version 2 – Did Version 1 Leave Anything in the Options File #521093This reply has been marked as private.Yes, exactly in review image value should be url of the image that uploaded before.
For now you can use media endpoint or any custom endpoint to upload image and get the image url. We have already task in our todo list to provide image upload endpoint within /geodir/v2/ api route.
Regards,
KiranHi stanm,
Use following PHP snippet to make post code & address 2 fields mandatory.
/** * Make post code & address 2 mandatory in add listing form. */ function gd_snippet_191212_make_zip_mandatory( $html, $cf ) { if ( ! empty( $html ) ) { // Make Zip/Post Code mandatory. $search1 = '<div id="geodir_address_zip_row"' . PHP_EOL . ' class="'; $replace1 = $search1 . 'required_field '; $search2 = 'initialize_autofill_address();'; $replace2 = $search2 . 'var $_zip = jQuery("#geodir_address_zip_row.geodir_form_row");$_zip.append("<span class=\"geodir_message_error\">' . esc_attr__( 'Post Code is required!', 'geodirectory' ) . '</span>");jQuery("label", $_zip).append(" <span>*</span>")'; // Make Adddress 2 mandatory. $search1 = '<div id="geodir_address_street2_row"' . PHP_EOL . ' class="'; $replace1 = $search1 . 'required_field '; $search2 = 'initialize_autofill_address();'; $replace2 = $search2 . 'var $_street2 = jQuery("#geodir_address_street2_row.geodir_form_row");$_street2.append("<span class=\"geodir_message_error\">' . esc_attr__( 'Town / County is required!', 'geodirectory' ) . '</span>");jQuery("label", $_street2).append(" <span>*</span>")'; $html = str_replace( array( $search1, $search2 ), array( $replace1, $replace2 ), $html ); } return $html; } add_filter( 'geodir_custom_field_input_address', 'gd_snippet_191212_make_zip_mandatory', 100, 2 );
Regards,
KiranHi Will,
Can you clarify more how you want to show dates?
Kiran
Hi acmug,
One of plugin converting
&
to
#038;
in html and it breaks JavaScript on the page.
Add following PHP snippet to fix this.
/** * Fix changing "&" to "& #038;". */ function gd_snippet_191211_the_content( $content ) { if ( ! empty( $content ) && strpos( $content, "geodir_" ) !== false ) { $content = str_replace( "&" . "#038;&" . "#038;", "&&", $content ); } return $content; } add_filter( 'the_content', 'gd_snippet_191211_the_content', 9999, 1 );
Let us know how it goes.
Regards,
KiranHi Vlad,
Glad to hear that rating stars are back in Google search results.
I have checked for those listings which are still missing stars in search results. It looks like Google shows rating stars in search results for specific schema types only mentioned at here https://developers.google.com/search/docs/data-types/review-snippet#aggregated_rating_type_definition
The listing uses schema type selected under default category from backend category edit page.
Let us know.
Regards,
KiranHi Tomas,
Done!.
Sorry i have changed admin user language to English to check issue. I have changed a language back to site default from WordPress Admin > Edit My Profile(from admin bar right corner) > Language > Site Default.
Thanks,
KiranHi,
Images should be uploaded to site via media endpoint or custom endpoint and the image url can be used to add images in add listing or add review endpoints.
Similar logic that we use in normal “add listing / add review” form. In frontend “add listing / add review” after selecting image it upload image to site via ajax and assigns the image url to listing/review during the listing/review submit.
FYI: we have a task in todo to check & implement image upload image via our own endpoint.
Regards,
KiranHi Kathy,
I have added one snippet under Snippets to fix image upload when there are many images to upload.
Kiran
Hi Thomas,
I have selected “Auto” template from GeoDirectory > Settings > Design > Details > Page template file override.
You can set widgets now under GD Sidebar to show on detail page
Kiran
Thanks for letting us know.
December 10, 2019 at 9:09 am in reply to: I turned GeoDirectory on and all EventOn pages show 404 #520766This reply has been marked as private.This reply has been marked as private.Hi Gerrit,
To submit reviews via REST API use following endpoints.
1) Using basic data:
?post=801&content=This is comment via API&rating=5
2) Using advance data:
?author=1&[email protected]&author_ip=127.0.0.1&author_name=Test User&author_url=https://www.google.co.in&status=1&post=801&content=This is comment via API&rating=5
Regards,
Kiran -
AuthorPosts