ZenphotoThe simpler media website CMS
How to add cache image sizes to a theme
For convenience (because my server can't deal with thumbnail generation on the fly) I need a few additional cached thumbnails to be generated by the theme I am using (zpBootstrap).
At the moment I see a bunch of "registered" cached image generation options when I use cache manager including for theme Garland and plugin zenpages (etc).
I'm looking into the zpBootstrap theme code /zpBootstrap-master/themeoptions.php and there appears to be a proper initialization section
if (class_exists('cacheManager')) {
and call to register the sizes
cacheManager::addCacheSize($me, NULL, 1000, 500, 1000, 500, NULL, NULL, NULL, $img_wmk, $img_effect, false);
but I don't see this option when I use the cache manager.
Can you point me to what might be wrong?
(when I fix that I think I can figure out how to add the sizes I want to add)
Comments
On the cacheManager page there should be a checkbox list with an entries for themes and some plugins. In front of it is an arrow icon you can click on to fold out the list of registered sizes for this theme or plugin.
I found this but zpBootstrap is not there even though it declares some sizes.
I see Garland and zenPage and some others but not zpBootstrap
I haven't been able to figure out why the zpBootstrap theme doesn't show up as an entry on the cache manager screen when the other processes that check-in do.
I can see the zpBootsdtrap-master entries in the MySQL DB.
Anyways - short cut for now is to add the necessary thumbnails as admin to the cache manager itself and that works.
Realized I needed to restart cache manager to get the new values into the DB (disable cache manager plug-in and then enable it again).
All works to pre-generate the cache values and FTP them to my "feeble" host and everything seems to work for both desktop and mobile browser clients.
Thanks for the helping hand, much appreciated.
Seriously - the theme folder actually has to be named zpBootstrap and not zpBootstrap-master as it comes from the repository else the cacheManager will not display the zpBootstrap theme options allowing you to select the zpBootstrap thumbs added in themeoptions by the addCacheSize. I wonder what else wasn't working because of that?
I guess it doesn't consider it a "valid" theme.
I infer from the theming tutorial that theme_description.php contains everything about the theme. I see that the default file with the zp-bootstrap-master download says that the themes name is zpBootstrap so I suppose they need to match ?
live and learn ...
Yes, indeed. It is a "mistake" from original repo that the theme is not in a subfolder with the correct name already. The folder name is the theme theme name. theme_description.php defines the display name/title.
The cache definitions are in themeoptions.php