Tips and Tricks HQ Support Portal › Forums › WP Photo Seller › WP Photo Sheller Template 4 – Thumbnail Size Change – Bulk Import
- This topic has 8 replies, 2 voices, and was last updated 8 years, 4 months ago by Peter.
-
AuthorPosts
-
July 6, 2016 at 9:52 am #13577kopicinfoMember
Dear Team,
i would like to change the Thumbnail Size to 259×259. I have already changed the css File /wp-content/plugins/wp-photo-seller/views/photo/template-4/gallery-template-4.css?ver=2.1.3
But it still use the following Thumbnail url… i dont know why: <img alt=”test” src=”http://freshlight-fotografie.de/wp-content/uploads/wp_photo_seller/9/Test-150×150.jpg”>
i still uploading with the “Bulk Import Function”. Where can i change the size from 150×150 to 259x259px.
Many thanks
This is the Testpage:
[http://freshlight-fotografie.de/test-thumb/]
July 6, 2016 at 10:18 pm #73632PeterMemberYou can’t change the thumb source size for that template because it is coded to use only the 150px thumbs. Have you looked at the other templates? Maybe you might find one which suits your needs?
July 11, 2016 at 8:41 am #73633kopicinfoMemberHi,
yes i know its codeded for 150px but i would like to change it. i always displayed in the right 259×259. but i think i have to change it at the upload function. in which file i will find the code?
I need to show it in 259x 259px
July 12, 2016 at 5:12 am #73634PeterMemberbut i think i have to change it at the upload function. in which file i will find the code?
No it’s more complicated than that.
I will need to examine the code more carefully to see if it is possible to add some filters instead.
July 12, 2016 at 11:37 am #73635kopicinfoMemberOk,
i hope you will find fast an soultion. Because i need it quickly..
thank you in advance…!
best regards
July 12, 2016 at 12:01 pm #73636kopicinfoMemberI think i solved my problem. I found it in ..modelsWPSPhotoProduct.php
function create_photo_product_by_id($image_id, $custom_var_id=”, $thumb_w=’150′, $thumb_h=’150′)
July 12, 2016 at 12:51 pm #73637PeterMemberPlease note that we do not support any changes made to the core plugin code.
Also, you will lose those changes if you ever upgrade this plugin to a future release.
In other words if you want to modify the code that’s fine but as long as you understand that we cannot provide support for those changes.
July 12, 2016 at 1:43 pm #73638kopicinfoMemberYes i know … i have one more question. Perhaps you can answer it quickly. I still add “Add to Card” via shortcode [WPS_display_compact_cart]. I would like to add this shorcode directly in my php file here.
<div id=”content-wrap” class=”container boxed”>
<div class=”breadcrumb row boxed”>
>>>>>>>>>>>>>> HERE [WPS_display_compact_cart]
</div>
what i have to do? – how can i call the function in PHP file
July 13, 2016 at 1:14 am #73639PeterMemberOk I have a better way to do this thumbnail change and it doesn’t require you to mess with the photo seller.
I have sent you a copy of a newer version which contains a filter.
You will need to add some code to your theme’s functions.php file.
The following is what you will need to add to your functions.php:
add_filter( 'wps_template4_thumb_path', 'change_template4_thumb', 10, 7 );
function change_template4_thumb( $thumb_url, $image_file_path, $source_dir, $source_dir_url, $special_image_dir, $image_id, $gallery_id ){
$path_info = pathinfo($image_file_path);
$thumb_name = $path_info['filename'].'-259x259.'.$path_info['extension'];
$thumb_path = $source_dir . $thumb_name;
//create a thumb for front end
if(!file_exists($thumb_path)){
$thumb_in_special_dir = $source_dir .'/'.$special_image_dir.'/'.$thumb_name;
if(file_exists($thumb_in_special_dir)){
//simply copy this file to this gallery's root dir
copy($thumb_in_special_dir, $thumb_path);
}else{
$resized_file = image_make_intermediate_size($image_file_path, '259', '259', true); //Make a thumb
if(!$resized_file){
//failed!
return $thumb_url;
}else{
//We need to copy the newly created thumb from special folder to root folder
copy($thumb_in_special_dir, $thumb_path);
}
$thumb_url = $source_dir_url.$thumb_name;
}
}else{
$thumb_url = $source_dir_url.$thumb_name;
}
return $thumb_url;
}The above will produce 259×259 thumbnails. (I tested it and it works)
Then you will need to produce your own custom CSS to make the 150 size boxes larger.
-
AuthorPosts
- You must be logged in to reply to this topic.