Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #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
    Yvonne

    #1477154

    Hey northorie,
    Please link to your post so we can examine.

    Best regards,
    Mike

    #1477176

    Link

    The big images on single post seem to be upscaled, the look “unsharp” and not good.

    Best regards

    #1477195

    Hi,
    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.
    Screen Shot 2025 02 16 at 7.31.56 AM
    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,
    Mike

    #1477202

    Thank 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

    #1477212

    Hi,

    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,
    Ismael

    #1477238

    It’s perfect now! thanks a lot :)
    Topic can be closed

    Best regards

    #1477239

    Oh, one more question. Can I change to a different height on mobile?

    #1477262

    Hi,
    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,
    Mike

    #1477321

    Perfect, thanks a lot!
    Topic can be closed now.

    #1477335

    Hi,

    Thanks for the update. Please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Single Post: Change Headline and Image’ is closed to new replies.