Codeless
  • Support Home
  • Themes
  • Support
  • WordPress Tutorials
    • How to Start a Blog
    • Best Website Builders
    • Best Small Business Hosting
    • Email Marketing Services
    • Cheap WordPress Hosting
  • Video Tutorials

Community Forums

Trouble with images

images
    • 9 years, 8 months ago mepatek
      Participant

      Expired

      Hello,

      we have a trouble with images. All images that are not in the default size are weirdly cropped. Especially those images in the portfolio. I get why they have to be cropped but can we perhaps change the way thay are cropped and not center the result but crop everything except the left corner? I hope I described the situation correctly. I’m adding an image so you can see what I mean better.

      We don’t want it to be the case 1, we want the case 2.

      Best regards

      Mepatek

    • 9 years, 8 months ago Mirela
      Participant

      Hello,

      The code responsible to register a new image size image is in function codeless_images_sizes():
      add_image_size ( string $name, int $width, int $height, bool|array $crop = false )

      Cropping behavior for the image size is dependent on the value of $crop:

      If false (default), images will be scaled, not cropped.
      If an array in the form of `array( x_crop_position, y_crop_position ):
      x_crop_position accepts ‘left’ ‘center’, or ‘right’`.
      y_crop_position accepts ‘top’, ‘center’, or ‘bottom’. Images will be cropped to the specified dimensions within the defined crop area.
      If true, images will be cropped to the specified dimensions using center positions.

      Example, if you want to scale the images of blog then find this line:
      add_image_size( 'blog', 825, 340, true );
      and replace with this:
      add_image_size( 'blog', 825, 340, array( 'left', 'top') );

      Source file: specular/functions.php (line 145)

      Best regards!

    • 9 years, 8 months ago mepatek
      Participant

      Expired

      Hello,

      thank you for your response.

      Do I have to clear the cache or something for this to work? I have changed the code in functions.php to:

      add_image_size( ‘port3’, 600, 600, array( ‘left’, ‘top’) );
      add_image_size( ‘port3_grayscale’, 627, 470, array( ‘left’, ‘top’) );
      add_image_size( ‘port2’, 460, 275, array( ‘left’, ‘top’) );
      add_image_size( ‘port2_grayscale’, 940, 470, array( ‘left’, ‘top’) );
      add_image_size( ‘port4’, 600, 600, array( ‘left’, ‘top’) );

      Portfolio images are still the same, though.

      Best regards

      Mepatek

    • 9 years, 8 months ago Mirela
      Participant

      Hello,

      Please import again the images. And run a plugin to recreate the thumbnails.

      Best regards!

    • 9 years, 7 months ago mepatek
      Participant

      Expired

      Hi,

      the plugin that recreates the thumbnails works. Thanks!

       

      Mepatek

Viewing 4 reply threads

You must be logged in to reply to this topic.

Login

Log In
Register

Renew Support

  • Renew Specular Support
  • Renew Tower Support
  • Renew Folie Support
  • Renew Handel Support
  • Renew June Support
  • Renew Picante Support
  • Renew Thype Support
  • Renew Regn Support

Search Forums

Forums

  • Bygge – Construction Theme
  • Converta – Software Theme
  • Folie – The WordPress Website Builder
  • Handel – Responsive Multi-Purpose Business Theme
  • June WooCommerce WordPress Theme
  • Livecast – Podcast Theme
  • Picante – Restaurant & Food WordPress Theme
  • Regn | Agency & Business WordPress Theme
  • Remake – Minimal Portfolio & Agency Theme
  • Specular – Multi-Purpose WordPress Theme
  • Suggest us Features
  • Tower – Business-Driven Multipurpose WP Theme
  • Vibrance – Photography Theme

Site Links

  • Support Policy
  • Specular Support Forum
  • Video Tutorials
  • Knowledge Base
  • Guides and Reviews

Useful Articles

  • Build a Website
  • Web Design & Development
  • Hosting
  • WordPress

Login

Log In
Register Lost Password