Naveen Giri
Forum Replies Created
-
AuthorPosts
-
Hi joy,
For #1, you can use following snippet.
add_filter('geodir_location_meta_value', 'geodir_location_meta_value_callback', 10,4 ); function geodir_location_meta_value_callback( $value, $_type, $info, $instance ){ if( !empty( $instance['key'] ) && 'location_image' == $instance['key'] ){ $value = wp_get_attachment_image_url( $info->image, $instance['image_size'], "", array( "class" => "img-responsive" ) ); } return $value; } add_action( 'wp_head', function () { global $gd_post; $image_url = do_shortcode("[gd_location_meta title='search' type='' key='location_image' image_size='full' no_wrap='true' alignment='' text_alignment='' list_hide='' list_hide_secondary='' css_class='' ]"); $featured_img = get_the_post_thumbnail_url($gd_post->ID, 'full'); $image_url = ( !empty( $image_url ))? $image_url : $featured_img; ?> <style> #custom-location-page-header{ background: url( ' <?php echo $image_url; ?>'); background-position: center center; background-size: cover; } </style> <?php } );
for #2, that is customization request. you can take help of our GD experts
http://geodirectoryexperts.com/Thanks
Please have a look now, you should have that option now.
Hi Joy,
Just reconfirmed, the location meta is not yet in Location manager v-2.0.0.24.
It will be released in the upcoming version.
If you want that I can add a patch for you.Please share your site details in a private reply.
Thanks
Hi Adrien,
The script is correct and added from
https://developer.wordpress.org/reference/hooks/comment_form_default_fields/
It’s working fine.
Hi joy
if you have latest version of the location manager addon. there is a block that you can to pull location meta’s, like location images.
You can also use the below shortcode to pull the current location image.
[gd_location_meta title='search' type='' key='location_image' image_size='' no_wrap='false' alignment='' text_alignment='' list_hide='' list_hide_secondary='' css_class='' ]
If you building the page with elementor layouts. maybe you will have to do some CSS adjustments.
Thanks
Thanks for the confirmation, Stay safe from COVID-19.
Hi Joe,
Please paste the full code you trying inside < code> tag.
I will check and send you the correct code back.
Thanks
Thanks for confirming. Stay safe from COVID-19.
Hi Joe,
Please replace this line in your code in the begining.
$args = array('post_type' => 'gd_place', 'orderby' => 'title', 'order' => 'DESC') ;
Thanks
Hi Matt,
for #2, you can try this code snippet.
add_filter( 'get_terms', 'custom_cat_count_get_terms', 8, 4 ); function custom_cat_count_get_terms( $terms, $taxonomy, $query_vars, $term_query ){ remove_filter( 'get_terms', array( 'GeoDir_Event_Query', 'get_terms' ), 9, 4 ); return $terms; }
Thanks
GD is saving images for portfolio, magazine, accordions, gallery, masonry and so on.
If ( portfolio, magazine, accordions, gallery, masonry ) images sizes are defined in WordPress. every new post image will get cropped in those sizes.
there is an only possible way to not allow those images from creation is to remove the add_image_size() function call for those sizes.Those images will never be used, GD is storing them itself without access to them.
As there is no access to them, you can’t clean the library, because the images are not there.
How you found that GD storing it without any public access?
Could you please also share FTP and Site details so we can check it from our side?Thanks
Hi P O,
In WordPress we define sizes using add_image_size function. Generally, images sizes are defined in the theme function.php
https://developer.wordpress.org/reference/functions/add_image_size/This function itself does not have any check for the post type.
So if a size got added using it. It will be applicable to all the uploaded images on WordPress.If you want to completely disable a few image sizes for specific post types.
You can search for the following code: add_image_size and/or set_post_thumbnail_size and comment it. Since its a customization. You can look for our GD ExpertsIf you want to delete unused images. you can follow this article.
https://wpengine.com/resources/wordpress-media-library-clean-up/Thanks
This reply has been marked as private.Please use,
global $gd_post; $field_value = $gd_post->merchantarticleupload; $field_value_array = explode( '|', $field_value ); $file_url = ( !empty( $field_value_array[0] ) )? $field_value_array[0]: ''; echo $file_url;
Thanks
the patch is inside the location manager addon. which will be released in the upcoming version.
but based on the issue. I have applied it to your site.
-
AuthorPosts