
-
AuthorPosts
-
February 15, 2025 at 12:45 pm #1477141
Hello,
is there a way to change the headline and image position on a single post?
I would like the post image to be right under the menu without any space – or maybe just a very small space and the tile underneath the image.Best regards
YvonneFebruary 15, 2025 at 3:53 pm #1477154February 15, 2025 at 8:35 pm #1477176The big images on single post seem to be upscaled, the look “unsharp” and not good.
Best regards
February 16, 2025 at 1:54 pm #1477195Hi,
Try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:function custom_script() { ?> <script> window.addEventListener('DOMContentLoaded', function() { (function($){ $('.single-post').each(function() { $(this).find('.entry-content-header').css({'margin-top':'15px'}).insertAfter($(this).find('.big-preview').css({'margin-top':'0'})); }); })(jQuery); }); </script> <?php } add_action( 'wp_footer', 'custom_script', 99 );
Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.
To use the full size featured image for single posts with a sidebar, instead of the 845×321 size that will be upscaled, add this code to the end of your child theme functions.php file in Appearance ▸ Editor:add_filter( 'post_thumbnail_size', 'custom_single_event_post_thumbnail_size' ); function custom_single_event_post_thumbnail_size($size) { if( !is_singular('post') ) { return; } if( ! has_post_thumbnail() ) { return; } $size = 'full'; return $size; }
Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.
Best regards,
MikeFebruary 16, 2025 at 7:41 pm #1477202Thank you! This helps!
Can I “cut” the image somehow using php? I don’t want cut the image itself, but want to have it not that high, but smaller, on the single post page.Best regards
February 17, 2025 at 1:22 am #1477212Hi,
You can add this css code to adjust the height of the featured image.
.small-preview, .big-preview { max-height: 200px; } .small-preview img, .big-preview img { width: 100%; height: 200px; object-fit: cover; }
Best regards,
IsmaelFebruary 17, 2025 at 12:15 pm #1477238It’s perfect now! thanks a lot :)
Topic can be closedBest regards
February 17, 2025 at 12:16 pm #1477239Oh, one more question. Can I change to a different height on mobile?
February 17, 2025 at 5:24 pm #1477262Hi,
Try adding this CSS in your Enfold Theme Options ▸ General Styling ▸ Quick CSS field:@media only screen and (max-width: 767px) { .small-preview, .big-preview { max-height: 200px; } .small-preview img, .big-preview img { width: 100%; height: 200px; object-fit: cover; } }
and adjust the height to suit.
Best regards,
MikeFebruary 18, 2025 at 12:23 pm #1477321Perfect, thanks a lot!
Topic can be closed now.February 18, 2025 at 2:44 pm #1477335Hi,
Thanks for the update. Please open a new thread if you should have any further questions or problems.
Best regards,
Rikard -
AuthorPosts
- The topic ‘Single Post: Change Headline and Image’ is closed to new replies.