Jump to content

Archived

This topic is now archived and is closed to further replies.

erin-wsk

Aspect-Thumb & Landscape-Thumb Sizes

Recommended Posts

erin-wsk    10
erin-wsk

On my site, many of my featured images are portrait and when I was working with the framework, the plug-ins/magazine layout pulled from one of the wordpress image sizes. However, I've run into multiple instances on DMS where the image is cropping in odd ways and I tracked this issue to the follow snippet in the library.wordpress.php: 

 

add_theme_support( 'post-thumbnails' );
add_image_size( 'aspect-thumb', 600, 900, true );
add_image_size( 'basic-thumb', 400, 400, true );
add_image_size( 'landscape-thumb', 600, 900, true );
 
Just to test out my theory, I updated these sizes and ran a regenerator and was able to get the image sizes I desired. However, obviously, I'm not suppose to change the core theme files and when I update, it all disappears.
 
That was my long way of asking: is there a way to add this into a child theme to override the sizes with new ones? Thanks!

Share this post


Link to post
Share on other sites
Rob    547
Rob

Are you trying to use the Framework slider in DMS?


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
erin-wsk    10
erin-wsk

No, I would like to update the cropping sizes for use with the flipper section (landscape-thumb) and for the magazine blog layout (attachment-thumb). 

Share this post


Link to post
Share on other sites
Danny    1,327
Danny
Hi, This isn't really an issue, as not many people would want to have those image sizes, so great job on finding this out yourself and adding the code. However, as you said this will continually be removed upon update. This is the whole reason for the use of a Child theme or the PageLines Customize plugin. What you will want to do is, add this code to either the Child Themes or the Customize Plugins Functions.php file. In doing so, your custom code will remain even upon update to DMS. You can download a DMS child theme from here - https://github.com/bearded-avenger/nicks-base-theme

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
erin-wsk    10
erin-wsk

Hi Danny, 

 

I'm already using the child theme and my specific question is if I could be pointed in the direction of what code to add (beyond the obvious sizes). I'm familiar with hooks but not familiar enough with php to know how to add this snippet to my custom functions file. Thoughts?

Share this post


Link to post
Share on other sites
Danny    1,327
Danny
PHP isn't currently my forte, but as far as I am aware you should just add that code to your child themes functions.php file.

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
erin-wsk    10
erin-wsk

Okay, I wasn't sure but that makes sense. I got it working by adding the the action and changing the function name so there wouldn't be a conflict. Mystery solved!

  • Like 1

Share this post


Link to post
Share on other sites

×