blog entries – featured images

This topic contains 8 replies, has 4 voices, and was last updated by  Giri 7 years, 10 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #227807

    bjoern
    Full Member
    Post count: 14

    hello,

    the featured images from my blog entries or articles are not shown above the article. is there anyway to make them appear or do i have to post them inside the article?

    thank you

    #227939

    Kor
    Moderator
    Post count: 16516

    Hi bjoern,

    You can use the custom code below to display the featured image above the post but unfortunately, that would require lots of work to style it. Try using a larger image and see if it helps. Insert the code below into your theme functions.php file. Let us know how it goes.

    
    
    add_filter( 'the_content', 'dt_the_content_filter', 1 );
    function dt_the_content_filter( $content ) {
        if ( is_singular( 'post') ) {
            $thumb = get_the_post_thumbnail();
            $content = $thumb.$content;
        }
        // Returns the content.
        return $content;
    }
    #228007

    bjoern
    Full Member
    Post count: 14

    Thank you for the quick answer!

    But, the featured images i use for the blogentries are all 650×360 px. when i place an even bigger one, it stays the same. so it seems that it gets cropped inside the theme..

    #228351

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    that really depends on the theme, its css and your media settings.

    If you provide a link and admin credentials, we will have a look.

    Thanks

    #230464

    bjoern
    Full Member
    Post count: 14

    where i can edit the “img[Attributes Style]” as you see in the image attached? i just can´t find it

    or where exactly can i edit the style for the featured image..

    thank you!

    #230879

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    I’m not sure there is an option for that. I asked to the developers to let us know.

    Thanks

    #230883

    Giri
    Expired Member
    Post count: 3155

    Replace the code posted by kc, with this code

    
    
    add_filter( 'the_content', 'dt_the_content_filter', 1 );
    function dt_the_content_filter( $content ) {
        if ( is_singular( 'post') ) {
            $thumb = '<div class="thumb-banner">'.get_the_post_thumbnail().'</div>';
            $content = $thumb.$content;
        }
        // Returns the content.
        return $content;
    }

    Now add this css to GD custom css setting

    
    
    .thumb-banner img {
       width: 100% !important;
       display: block;
    }
    #231240

    bjoern
    Full Member
    Post count: 14

    Thanks a lot! Already much better.. Anyways i have another issue here. Those images seem to get cropped in height. is there any way to permit that?

    this is the article: http://prnt.sc/bvmy03
    and when i open just the image, you can see that it is cropped like in the image attached.

    so, when i try to change the height in css, the image gets stretched away from original proportions. any idea how i can get rid of this?

    thanks a lot

    #231415

    Giri
    Expired Member
    Post count: 3155

    you need full width image. So it has 100% width. If you are using 100% width, you must use auto height.

    If you don’t want to crop thumbnails visit

    Settings -> Media

    section

Viewing 9 posts - 1 through 9 (of 9 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket