• 0
Sign in to follow this  
Followers 0

Aspect-Thumb & Landscape-Thumb Sizes

Question

Posted · Report post

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

6 answers to this question

  • 0

Posted · Report post

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.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Are you trying to use the Framework slider in DMS?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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
  • 0

Posted · Report post

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

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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
  • 0

Posted · Report post

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!

1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0