-
AuthorPosts
-
November 13, 2024 at 1:39 pm #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
November 14, 2024 at 4:08 am #1471284Hey 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,
IsmaelNovember 14, 2024 at 10:12 am #1471305Thanks, but it still shows the cropped version.
Do I have to select a special style?November 14, 2024 at 5:02 pm #1471323Hi,
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,
MikeNovember 15, 2024 at 9:05 am #1471375This reply has been marked as private.November 15, 2024 at 9:16 am #1471379Hi,
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,
IsmaelNovember 15, 2024 at 9:34 am #1471382Thanks.
But it did not work either.
I also re-uploaded the Thumbnail but the image eis still cropped on the post-detail-page.November 15, 2024 at 9:40 am #1471384please 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
November 15, 2024 at 9:43 am #1471385As 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 :)
November 15, 2024 at 10:04 am #1471387This reply has been marked as private.November 15, 2024 at 10:16 am #1471388try 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 imageNovember 15, 2024 at 10:30 am #1471389This reply has been marked as private.November 15, 2024 at 10:51 am #1471390or 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)
November 15, 2024 at 11:14 am #1471393This reply has been marked as private.November 15, 2024 at 12:26 pm #1471399Sorry, 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.November 15, 2024 at 4:08 pm #1471412just 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 );
-
AuthorPosts
- You must be logged in to reply to this topic.