• Resolved stug2013

    (@stug2013)


    Hi, Is it possible to enforce the size of image in the slider to be always the same. What I find at the moment is that there are a couple a bit bigger and they send the page up and down as they scroll into view. You can see it here. https://loveyogaanatomy.com
    thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi stug2013. The image size used for the slider is the theme size “thumb-large” which is 720×340. The image is then sized proportionately to fit the slider content width which, with a 2-column layout, is 712px. So the normal slider image is 712×336. However, it appears that some images do not have the default “thumb-large” size so the theme is using the original (?) image. For example, the Julie Martin image being used is 300×340. Expanding that to the 712px width gives a size of 712×807.

    You can use css to “enforce” a standard image height; this will compress those images which are larger than the limit:

    #flexslider-featured img {
      max-height: 336px;
    }

    You could also try the Regenerate Thumbnails plugin to see if it can reset the image thumbnails. Note also that this will not completely solve the issue of the page content shifting up and down. That movement is also affected by the length of the featured post excerpt/content being displayed in the slider.

    Hope that helps.

    Thread Starter stug2013

    (@stug2013)

    Thanks bdbrown that really help. As a sort of fix I could now make sure all the featured images conform to the right size. To make all the excerpts the same length is it possible to set a limit by character?
    thanks Stu

    Add this to your child theme functions.php file. Set the $chars variable number to how many characters you want to display. I haven’t tested it so no guarantees but I think it should work.

    function my_excerpt($text) {
      $chars = 99;
      $excerpt = $text;
      $excerpt = preg_replace(" (\[.*?\])",'',$excerpt);
      $excerpt = strip_shortcodes($excerpt);
      $excerpt = strip_tags($excerpt);
      $excerpt = substr($excerpt, 0, $chars);
      $excerpt = substr($excerpt, 0, strripos($excerpt, " "));
      $excerpt = trim(preg_replace( '/\s+/', ' ', $excerpt));
      return $excerpt;
    }
    add_filter('the_excerpt', 'my_excerpt');
    Thread Starter stug2013

    (@stug2013)

    Thanks so much I will give it a go.

    hi sir i visit your site! https://loveyogaanatomy.com

    how do you do that the header image or logo is centered

    please help me thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘featured post slider, image sizes’ is closed to new replies.