Jump to content


Photo
- - - - -

Aspect-Thumb & Landscape-Thumb Sizes


Best Answer Danny , 01 September 2013 - 06:21 PM

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. Go to the full post


  • Please log in to reply
6 replies to this topic

#1 erin-wsk

erin-wsk

    Advanced Member

  • Members

  • 85 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 31 August 2013 - 11:11 PM

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!


#2 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 01 September 2013 - 12:46 AM

Are you trying to use the Framework slider in DMS?



#3 erin-wsk

erin-wsk

    Advanced Member

  • Members

  • 85 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 01 September 2013 - 03:34 AM

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). 



#4 Danny

Danny

    Is Awesome!

  • Moderators
  • 17139 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 01 September 2013 - 08:26 AM

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/b...icks-base-theme

#5 erin-wsk

erin-wsk

    Advanced Member

  • Members

  • 85 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 01 September 2013 - 03:09 PM

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?



#6 Danny

Danny

    Is Awesome!

  • Moderators
  • 17139 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 01 September 2013 - 06:21 PM   Best Answer

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.

#7 erin-wsk

erin-wsk

    Advanced Member

  • Members

  • 85 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 01 September 2013 - 08:18 PM

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!


  • Danny likes this