How to change thumbnail sizes

Posted in: Newspaper
Post count: 6

Hello,

I searched the forum but I didn’t found an answer to my question. All I found was this topic: https://forum.tagdiv.com/topic/how-to-change-the-thumps-on-module-block-sizes/ where a user modified the front width of elements and because of this the thumbnails are not shown properly.

I want to do the same thing. I have modified the width of the main container on the frontend and I want to edit the dimensions of the thumbnails generated by the theme for various blocks. I have found the place in the theme where this sizes are set, in Newspaper-tf\includes\td_config.php line 1324-1593. But I do not want to edit the theme files, because all of my edits will be gone on the next theme updates.

I am looking for a way to hook into those functions and change the size of the generated thumbnails for various blocks from the functions.php file of the child theme, so that my edits will be there after the next theme update.

Best regards,
Mircea

Post count: 20688

Hi,

If you would like to change the thumbnail sizes for the modules, this can only be done in that respective file. This is not supported through the child theme and the modifications will have to be made directly to the theme core file.
Or you can try this using the api – https://forum.tagdiv.com/td_api_thumbadd/
This would require advanced coding skills and if you are not aware of the steps needed, I suggest considering hiring a freelancer/developer to help you implement this customization, because we can not provide custom work at the moment, sorry. Also if you decide to try this method it would be best to experiment on a test site before, in case something goes wrong.

Thank you for understanding!

Post count: 6

Thank you for your response.

I have a few follow-up questions:

1) Do you plan to make this section pluggable from child theme in future versions? Maybe wrapping each API call in a function and wrapping the function in a condition like if {!function_exists(function))} will allow users to override the thumbnails settings from functions.php.

2) If I make custom thumbnail sizes using the API, how will I be able to use those new thumbnails in the block templates? I see the thumbnails are called in includes/modules/td_module_#.php files. How can I modify these files so that the new template is preserved after theme update? If I make a copy of the file in the child theme using the same folder structure, will my file get precedence before the theme file in generating the output?

And on an unrelated topic, will you consider making available two licenses with each theme purchase, one for the live site and one for the development site? The guys at Themco do this for their X theme and you register your live and development site on their platform and you are able to make automatic theme updates on the development site. Right now I have the theme installed on my development site but I have the „Acticvate theme” error message on my dashboard. Once I move the site to the live domain I will activate the license I bought, but would be interesting to have a development license as well.

Best regards,
Mircea

Post count: 20688

Hi,

If you would like to create a new thumbnail size for an existing module, you can define that new thumb size using the method provided in the previous link, in the api plugin. You can download the plugin here
https://forum.tagdiv.com/practical-example-how-to-add-a-new-block-and-module/
Then using the child theme modify an existing module to use the custom thumbnail size, from the plugin. I believe this should work properly.
Just make sure to regenerate your thumbnails – https://forum.tagdiv.com/thumbnails-fix-strange-looking-images-on-blocks/ so the new size will be created.
This way you will not loose this customization with a theme update, everything is done through the plugin and child theme. Maybe additional options regarding this will be available in a future release, but I could not say for sure if this will happen.
About the license, the Envato license specifies you can use the theme on a single end-product at a time
http://themeforest.net/licenses/standard
A sub-domain however can be used and the theme activated on it, if it’s part of the same project. You can use the theme on this sub-domain, as long as it will not be a different website with different content.

Thanks

Post count: 6

Hello Simion,

Thank you for your response. Regarding the license, I activated it on my subdomain that is the staging site for my main site. There I test the updates before I apply them to the live website, so it’s the same website, just different URL.

Regarding my problem with resizing the thumbnails, I discovered a simpler method to do this. Reading the documentation, I found out about the update call for the API, so I took the following steps, maybe somebody will find them useful in the future:
– Make a plugin according to the documentation: https://forum.tagdiv.com/the-plugin-method/
– Make an API update call like specified here: https://forum.tagdiv.com/td_api_thumbupdate/
– modify just the width and height of the image to suit your needs.

After this, regenerate the thumbnails and the new dimensions will pop up in the site. I didn’t need to make any edits to the modules templates in the child theme.

Best regards,
Mircea

Post count: 23312

Hello Mircea,

Thank you for your suggestion. This can be more useful for other clients.

Thanks.

Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Newspaper’ is closed to new topics and replies.