• 01-03-2022, 17:28:24
    #1
    Merhaba,

    Jannah temasına geçmiş bulundum. Sitede bulunan yazılarda ki ilk görseli anasayfada nasıl gösterebilirim. Öne çıkan görsel kısmından yapmak istemiyorum.

    functions.php dosyasına kod ekleyerek denedim oldu ancak bu seferde anasayfadaki görsellerin boyutları yazı içerisinde bulunan görsellerden farklı boyutta oldu büyük gözüktü.

    Bu sorunu nasıl çözebilirim.
  • 01-03-2022, 17:29:45
    #2
    PM atarsanız inceleyip yardımcı olmak isterim.
  • 01-03-2022, 17:32:18
    #3
    mucahitergul adlı üyeden alıntı: mesajı görüntüle
    PM atarsanız inceleyip yardımcı olmak isterim.
    PM gönderildi.
  • 01-03-2022, 18:54:06
    #4
    Aynı problemi yaşayıp yolu bu konuya düşenler için amme hizmeti

    Sitenizi blogger altyapısından wordpresse taşıdıysanız veya önceden paylaştığınız içeriklerde öne çıkarılan görselleri ayarlamadıysanız kuracağınız wordpress temalarında problem yaşayabilirsiniz.
    Bu soruna çözüm olarak kısa bir functions.php kodu paylaşıyorum. Kod içeriklerinizde belirlenmiş bir önce çıkarılan görsel var mı diye kontrol ediyor eğer yok ise yazı içerisindeki ilk resmi öne çıkarılan görsel olarak belirliyor.

    Kodlarla uğraşmak istemeyenlerde bu eklentiyi kullanabilir > https://wordpress.org/plugins/easy-add-thumbnail/



    if ( function_exists( 'add_theme_support' ) ) {
    
        add_theme_support( 'post-thumbnails' ); // This should be in your theme. But we add this here because this way we can have featured images before swicth to a theme that supports them.
    
        function easy_add_thumbnail($post) {
    
            $already_has_thumb = has_post_thumbnail();
            $post_type = get_post_type( $post->ID );
            $exclude_types = array('');
            $exclude_types = apply_filters( 'eat_exclude_types', $exclude_types );
    
            // do nothing if the post has already a featured image set
            if ( $already_has_thumb ) {
                return;
            }
    
            // do the job if the post is not from an excluded type
            if ( ! in_array( $post_type, $exclude_types ) ) {
                // get first attached image
                $attached_image = get_children( "order=ASC&post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" );
    
                if ( $attached_image ) {
                    $attachment_values = array_values( $attached_image );
                    // add attachment ID
                    add_post_meta( $post->ID, '_thumbnail_id', $attachment_values[0]->ID, true );
                }
            }
        }
    
        // set featured image before post is displayed (for old posts)
        add_action('the_post', 'easy_add_thumbnail');
    
        // hooks added to set the thumbnail when publishing too
        add_action('new_to_publish', 'easy_add_thumbnail');
        add_action('draft_to_publish', 'easy_add_thumbnail');
        add_action('pending_to_publish', 'easy_add_thumbnail');
        add_action('future_to_publish', 'easy_add_thumbnail');
    }
  • 01-03-2022, 18:55:46
    #5
    mucahitergul adlı üyeden alıntı: mesajı görüntüle
    Aynı problemi yaşayıp yolu bu konuya düşenler için amme hizmeti

    Sitenizi blogger altyapısından wordpresse taşıdıysanız veya önceden paylaştığınız içeriklerde öne çıkarılan görselleri ayarlamadıysanız kuracağınız wordpress temalarında problem yaşayabilirsiniz.
    Bu soruna çözüm olarak kısa bir functions.php kodu paylaşıyorum. Kod içeriklerinizde belirlenmiş bir önce çıkarılan görsel var mı diye kontrol ediyor eğer yok ise yazı içerisindeki ilk resmi öne çıkarılan görsel olarak belirliyor.

    Kodlarla uğraşmak istemeyenlerde bu eklentiyi kullanabilir > https://wordpress.org/plugins/easy-add-thumbnail/



    if ( function_exists( 'add_theme_support' ) ) {
    
        add_theme_support( 'post-thumbnails' ); // This should be in your theme. But we add this here because this way we can have featured images before swicth to a theme that supports them.
    
        function easy_add_thumbnail($post) {
    
            $already_has_thumb = has_post_thumbnail();
            $post_type = get_post_type( $post->ID );
            $exclude_types = array('');
            $exclude_types = apply_filters( 'eat_exclude_types', $exclude_types );
    
            // do nothing if the post has already a featured image set
            if ( $already_has_thumb ) {
                return;
            }
    
            // do the job if the post is not from an excluded type
            if ( ! in_array( $post_type, $exclude_types ) ) {
                // get first attached image
                $attached_image = get_children( "order=ASC&post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" );
    
                if ( $attached_image ) {
                    $attachment_values = array_values( $attached_image );
                    // add attachment ID
                    add_post_meta( $post->ID, '_thumbnail_id', $attachment_values[0]->ID, true );
                }
            }
        }
    
        // set featured image before post is displayed (for old posts)
        add_action('the_post', 'easy_add_thumbnail');
    
        // hooks added to set the thumbnail when publishing too
        add_action('new_to_publish', 'easy_add_thumbnail');
        add_action('draft_to_publish', 'easy_add_thumbnail');
        add_action('pending_to_publish', 'easy_add_thumbnail');
        add_action('future_to_publish', 'easy_add_thumbnail');
    }
    Hocam bunu kursak css kendi ayarlar mı
  • 01-03-2022, 23:18:53
    #6
    Olmadi maalesef baska yardimci olabilecek var mi @Onur89TR; hocam desteginizi rica ederim
  • 02-03-2022, 00:12:52
    #7
    CyberRooT adlı üyeden alıntı: mesajı görüntüle
    Merhaba,

    Jannah temasına geçmiş bulundum. Sitede bulunan yazılarda ki ilk görseli anasayfada nasıl gösterebilirim. Öne çıkan görsel kısmından yapmak istemiyorum.

    functions.php dosyasına kod ekleyerek denedim oldu ancak bu seferde anasayfadaki görsellerin boyutları yazı içerisinde bulunan görsellerden farklı boyutta oldu büyük gözüktü.

    Bu sorunu nasıl çözebilirim.
    Functions.php'ye eklediginiz kodu paylasir misiniz?
  • 02-03-2022, 00:21:09
    #8


    if ( function_exists( 'add_theme_support' ) ) {
    
        add_theme_support( 'post-thumbnails' ); // This should be in your theme. But we add this here because this way we can have featured images before swicth to a theme that supports them.
    
        function easy_add_thumbnail($post) {
    
            $already_has_thumb = has_post_thumbnail();
            $post_type = get_post_type( $post->ID );
            $exclude_types = array('');
            $exclude_types = apply_filters( 'eat_exclude_types', $exclude_types );
    
            // do nothing if the post has already a featured image set
            if ( $already_has_thumb ) {
                return;
            }
    
            // do the job if the post is not from an excluded type
            if ( ! in_array( $post_type, $exclude_types ) ) {
                // get first attached image
                $attached_image = get_children( "order=ASC&post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" );
    
                if ( $attached_image ) {
                    $attachment_values = array_values( $attached_image );
                    // add attachment ID
                    add_post_meta( $post->ID, '_thumbnail_id', $attachment_values[0]->ID, true );
                }
            }
        }
    
        // set featured image before post is displayed (for old posts)
        add_action('the_post', 'easy_add_thumbnail');
    
        // hooks added to set the thumbnail when publishing too
        add_action('new_to_publish', 'easy_add_thumbnail');
        add_action('draft_to_publish', 'easy_add_thumbnail');
        add_action('pending_to_publish', 'easy_add_thumbnail');
        add_action('future_to_publish', 'easy_add_thumbnail');
    }


    d3nnis adlı üyeden alıntı: mesajı görüntüle
    Functions.php'ye eklediginiz kodu paylasir misiniz?
    Yukarıda ki kodu ekledim ama olmadı nette araştırdım yine buna benzer kodlar ekledim yine olmadı. Kodları ekleyince anasayfada resimler çıkıyor evet ancak boyutu çok büyük oluyor css ile düzeltemedim.
  • 02-03-2022, 00:36:36
    #9
    gordugum kadariyla kod parcacigi boyutla ilgili bir sey icermiyor. dolayisiyla temanizin default degerlerini cekiyor.

    ucuncu satirdaki;

    add_theme_support( 'post-thumbnails' );

    altina;

    set_post_thumbnail_size( 100, 100 );

    ekelyip boyutta bir degisiklik olup olmadigini kontrol eder misiniz?