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

How to prevent staff featured image to be resized

imagestaff
    • 9 years, 11 months ago criscmaia
      Participant

      Expired

      I’m uploading a square image (500×500) as featured staff image. When I add a “Single Staff” element to my page, the image URL changes its proportion.
      Example:

      Original URL: https://i2.wp.com/mangostormplay.com/wp-content/uploads/me.png

      cropped URL: https://i2.wp.com/mangostormplay.com/wp-content/uploads/me.png?resize=400%2C270

       

      How do I stop the system to add the resize bit to the url?

       

      Thanks

    • 9 years, 11 months ago criscmaia
      Participant

      Expired

      This is the live version: https://mangostormplay.com/about-us/

    • 9 years, 11 months ago Mirela
      Participant

      Hello,

      You have to edit the image sizes from your functions.php file.
      Please go to this file and find this function: function codeless_images_sizes(){ Here are set all featured images sizes. When you upload an image, based on where it will be used, the image will be automatically cropped.
      The line you need to edit, for the staff featured image, is this one: add_image_size( 'staff', 400, 270, true ); Change the sizes to your need. Save file and re-upload the images.
      Or run a thumbnail recreation plugin.

      Best regards!

    • 9 years, 11 months ago criscmaia
      Participant

      Expired

      Thanks! This seems to be the solution, but I’m having trouble adding the functions.php file to the child theme. I’ve tried the 3 methos explained on this website ( https://code.tutsplus.com/tutorials/a-guide-to-overriding-parent-theme-functions-in-your-child-theme–cms-22623 )  but after I upload it the website stops responding.
      Do you have any tutorial on how I can add this function to my child theme?

       

      Thanks

    • 9 years, 11 months ago Mirela
      Participant

      Hello,

      We do not have yet a tutorial for child themes, as they are optional to users.
      Please refer to this article: https://codex.wordpress.org/Child_Themes. You may find this topic: https://stackoverflow.com/questions/19039492/override-a-function-with-child-themes-functions-php , useful too.

      Best regards!

    • 9 years, 8 months ago HDGadmin
      Participant

      Hi-

      I am having the same issue. I have images which are set at 200 px wide x 250 px tall. I want them that size on the page. I changed the code above to the dimensions that I wanted but the images are now just stretching to fit the column width. How can I turn off the stretching of the images?

    • 9 years, 8 months ago Mirela
      Participant

      Hello,

      Please upload images of a bigger size. They may be too small for the new size proportions.
      Let us know.

      Best regards!

    • 9 years, 8 months ago HDGadmin
      Participant
      This reply has been marked as private.
    • 9 years, 8 months ago Mirela
      Participant

      Hello,

      Please add these lines into your custom css box, for the staff image sizes:

      .single_staff .featured_img {
          width: 200px;
          height: 250px;
      }

      To display more text in description, go to file vc_templates\staff.php and find this line:
      $output .= '<p>'.codeless_text_limit(get_the_excerpt(), 25).'</p>';
      edit the 25 value to your need. The more you increase it, the more words it will display.

      Best regards!

Viewing 8 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