Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1441358

    Hi there

    Is there a way to change the featured image dimensions on an individual blog post? its hard to find images that are always landscape like the default sizing – be good to be able to just have whatever the original image size is if possible.

    Cheers
    Natasha

    • This topic was modified 5 months ago by xfacta.
    #1441371

    Hey xfacta,

    Thank you for the inquiry.

    You can adjust the default width and height of the thumbnails used in the blog posts by adding this code to the functions.php file:

    function avf_customization_modify_thumb_size( $size ) {
          $size['entry_without_sidebar'] = array( 'width' => 9999, 'height' => 9999 );
          $size['entry_with_sidebar'] = array( 'width' => 9999, 'height' => 9999 );
          return $size;
    }
    
    add_filter( 'avf_modify_thumb_size', 'avf_customization_modify_thumb_size', 10, 1 );

    After adding the code, you have to regenerate the thumbnails or upload the images again:

    // https://wordpress.org/plugins/regenerate-thumbnails/

    Please make sure to create a site backup before proceeding.

    Best regards,
    Ismael

    #1441376

    Hey Ismael

    ok great thank you – so that will just keep the featured image its actual size and not change/crop it to a fixed size?

    Cheers
    Natasha

    #1441388

    Hi,

    Thank you for the update.

    so that will just keep the featured image its actual size and not change/crop it to a fixed size?

    Yes, we set the maximum size of the post thumbnails (entry_with_sidebar and entry_without_sidebar) to 9999px, so uploading any images smaller than that size should remain or display as they are. After adding the code, please make sure to regenerate the thumbnails or upload the featured images again.

    Best regards,
    Ismael

    #1441394

    masonry image size is a non-cropped size too. ( or use full images )
    so – if you use that snippet in child-theme functions.php it will use that image-size format:

    function av_remove_featured_image_link($image) {
        if (is_single()) {
            $image = get_the_post_thumbnail( $current_post['the_id'], 'masonry' ); 
        }
        return $image; 
    }
    add_filter('avf_post_featured_image_link','av_remove_featured_image_link', 10, 1);
    #1441409

    Hi,


    @Guenni007
    : Thanks for the info.


    @xfacta
    : You can also try the filter provided by @Guenni007 above to change the post thumbnail.

    Best regards,
    Ismael

    #1441432

    Thank you both I will try that

    #1441455

    Try first only my solution without redefining the featured image source – this will only use a different image-size source for that featured image.
    And because masonry image-size is a non cropped size – use that.

    ________________________

    btw: on your copyright link in the footer you have made some mistakes.
    i would only insert that line:

    © Copyright - NSW Dowsers Society. All Rights Reserved. 
    

    and add to my child-theme functions.php:

    function new_backlink(){
    	$kriesi_at_backlink = " - <a href='https://xfactadesign.com' target='_blank'>Xfacta Design</a>";
    	return $kriesi_at_backlink;
    }
    add_filter('kriesi_backlink' , 'new_backlink');

    or maybe clearer in that way:

    function my_own_backlink($link){ 
      $no = "rel='nofollow'";
      $slogan = "Website Design by - ";
      $theme_string = "Xfacta Design"; 
      $backLink = "https://xfactadesign.com";
    
      $link = "{$slogan } <a {$no} href= {$backLink} target='_blank'>{$theme_string}</a>";
      return $link;
    }
    add_filter( 'kriesi_backlink', 'my_own_backlink', 10, 1);

    that snippet set the new value for the backlink. in this case you do not need to add the shortcode [nolink]

    #1443979

    @Guenni007 thanks so much for that functions info it worked perfectly :-)

    just on the copyright part why is what I have a mistake and needed to be added to the child theme functions?

    Cheers
    Natasha

    #1444404

    Hi,
    Your website link in the copyright (Website Design by) is broken, try clicking it.
    If you are not using a child theme you could use the WP Code plugin then add a new snippet, in the top right corner use the PHP snippet as the code type:
    Enfold_Support_2680.jpeg
    then add Guenni007’s code and save.

    Best regards,
    Mike

    #1444478

    Hey Mike

    thanks for letting me know that – I have fixed it now :-)

    Cheers
    Natasha

    #1444512

    Hi,
    Glad Guenni007 could help, thank you Guenni007, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Change dimensions of featured image in single blog post’ is closed to new replies.