Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #1471223

    Hello, how can I place the “full” image on top of a blog post with the original dimensions instead of a cropped version?

    THANKS

    #1471284

    Hey xela,

    Thank you for the inquiry.

    You can add this filter in the functions.php file:

    add_action("ava_after_main_title", function() {
      global $avia_config;
    
      if( is_singular("post") ) {
        $avia_config['image_size'] = 'full';
        $avia_config['preview_mode']  = 'custom';
      }
    }, 10);

    Best regards,
    Ismael

    #1471305

    Thanks, but it still shows the cropped version.
    Do I have to select a special style?

    #1471323

    Hi,
    Please include an admin login in the Private Content area so we can examine.
    Perhaps you copied the code above from and email and not the forum so the quotes were changed to “curly quotes” breaking the code.

    Best regards,
    Mike

    #1471375
    This reply has been marked as private.
    #1471379

    Hi,

    Thank you for the info.

    We may need to adjust the default size of the thumbnails. Please add this code in the functions. 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 );
    

    Then use the this plugin to regenerate the thumbnails.

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

    Please make sure to create a site backup before proceeding.

    Best regards,
    Ismael

    #1471382

    Thanks.
    But it did not work either.
    I also re-uploaded the Thumbnail but the image eis still cropped on the post-detail-page.

    #1471384

    please do not redefine the images_sizes!
    Just wait a little i test my solution first …

    see post : https://kriesi.at/support/topic/full-image-on-single-post/#post-1471388

    #1471385

    As it is a new page I do not need the uploaded images, there are just for testing-purposes. So it would be okay when only the “new” uploads would fit :)

    #1471387
    This reply has been marked as private.
    #1471388

    try both inside your child-theme functions.php:

    function avf_template_builder_content_postimage_mod($content = ""){
      if(  is_singular('post') || is_singular('portfolio') && ( '1' != get_post_meta( get_the_ID(), '_avia_hide_featured_image', true ) ) )  {
            $featuredImage = get_the_post_thumbnail( $the_id, 'original' );
            $content = '<header class="entry-content-header"><div class="page-thumb">' .$featuredImage. '</div></header>' . $content ;
          }
      return $content;
    }
    add_filter('avf_template_builder_content', 'avf_template_builder_content_postimage_mod', 10, 1);
    
    //image-sizes:  widget, square, featured, featured_large, extra_large, portfolio, portfolio_small, gallery, magazine, masonry, entry_with_sidebar, entry_without_sidebar, medium, large
    
    function custom_post_featured_image_link( $image_link, array $current_post, $size ){
      if(  is_singular('post') || is_singular('portfolio') && ( '1' != get_post_meta( get_the_ID(), '_avia_hide_featured_image', true ) ) )  {
        $image_link = get_the_post_thumbnail( $current_post['the_id'], 'original' ); /**** or medium, square etc. ***/
      }
      return $image_link;  // echo $image_link;  if you want to get rid of link function
    }
    add_filter( 'avf_post_featured_image_link', 'custom_post_featured_image_link', 10, 3 );

    these snippets have that check if on the editor mode – on the right side in the layout box “show/hide featured image on single post”
    so they will respect that setting.

    PS that comment : echo $image_link; if you want to get rid of link function. –
    Most people don’t like the fact that the featured image in single posts has a link to their own post. I think so too – that’s superfluous

    But
    – removing that link function will move the feature image out of the article container. That means the image is above all – title is beneath.
    So it might be better to have that link – and preserve enfold structure – but hamper only the pointer-event on that image

    #1471389
    This reply has been marked as private.
    #1471390

    or you take – mikes snippet to redeclare these formats – but with setting of crop to false!
    ( but the solution above is more elegant, and also shows the full resolution )

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

    the limitation value is not the width value – so you got smaller images. This is as Mike mentioned for the new images only – but if you recalculate the thumbs even the older posts will have that new size (without cropping)

    #1471393
    This reply has been marked as private.
    #1471399

    Sorry, I had to remove the scripts from the functions.php as it also affected the “portfolio”-pages.
    But all in all it now seems to work out quite well.

    #1471412

    just remove the portfolio from those snippets:

    function avf_template_builder_content_postimage_mod($content = ""){
      if(  is_singular('post') && ( '1' != get_post_meta( get_the_ID(), '_avia_hide_featured_image', true ) ) )  {
            $featuredImage = get_the_post_thumbnail( $the_id, 'original' );
            $content = '<header class="entry-content-header"><div class="page-thumb">' .$featuredImage. '</div></header>' . $content ;
          }
      return $content;
    }
    add_filter('avf_template_builder_content', 'avf_template_builder_content_postimage_mod', 10, 1);
    
    //image-sizes:  widget, square, featured, featured_large, extra_large, portfolio, portfolio_small, gallery, magazine, masonry, entry_with_sidebar, entry_without_sidebar, medium, large
    
    function custom_post_featured_image_link( $image_link, array $current_post, $size ){
      if(  is_singular('post')  && ( '1' != get_post_meta( get_the_ID(), '_avia_hide_featured_image', true ) ) )  {
        $image_link = get_the_post_thumbnail( $current_post['the_id'], 'original' ); /**** or medium, square etc. ***/
      }
      return $image_link;  // echo $image_link;  if you want to get rid of link function
    }
    add_filter( 'avf_post_featured_image_link', 'custom_post_featured_image_link', 10, 3 );
Viewing 16 posts - 1 through 16 (of 16 total)
  • You must be logged in to reply to this topic.