Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

WordPress’te Yazı Küçük Resmi URL’si Nasıl Alınır?

WordPress temaları ve alt temaları oluştururken, yazı küçük resmi görüntülenmediğinde geliştiriciler hayal kırıklığına uğrayabilir. Bu, geliştirme sırasında gerçek bir engel olabilir.

İhtiyaç duydukları şey, kodlarında kullanabilmeleri için resim URL’sini almanın basit bir yoludur.

Neyse ki, bu bizim sayısız kez yaptığımız bir şey ve bu yaygın sorunu çözmenin basit bir yöntemini biliyoruz.

Bu kılavuzda, WordPress’te yazı küçük resim URL’sini nasıl çıkaracağınızı göstereceğiz. İş akışınızı basitleştirebilecek ve size zaman kazandırabilecek kullanışlı bir hileyi paylaşacağız.

How to Get the Post Thumbnail URL in WordPress

WordPress’te Yazı Küçük Resmi URL’sini Neden Alalım?

WordPress blogunuzdaki yazılara bir küçük resim veya öne çıkan görsel eklemek, biraz görsel ilgi ekleyerek daha çekici görünmesini sağlayacaktır. WordPress’te öne çıkan görsellerin veya yazı küçük resimlerinin nasıl ekleneceğine ilişkin kılavuzumuzda daha fazla bilgi edinebilirsiniz.

Bir gönderiyi sosyal medyada paylaşmak istiyorsanız, öne çıkan görselin veya başka bir görselin bağlantısını gönderiye kopyalamanız gerekebilir. Bunu nasıl yapacağınızı WordPress’te yüklediğiniz görsellerin URL’sini nasıl alacağınıza ilişkin kılavuzumuzda adım adım gösteriyoruz.

Ancak, kendi temanızı geliştiriyorsanız veya mevcut bir temayı değiştiriyorsanız, kendi özel işaretlemenizle kullanabilmek için gönderi küçük resim URL’sini almanız gerekebilir. Bu durumda, tema dosyalarınıza bir kod parçacığı eklemeniz gerekecektir.

WordPress’te yazı küçük resim URL’sinin nasıl alınacağına bir göz atalım.

WordPress’te Yazı Küçük Resmi URL’si Nasıl Alınır?

Bir gönderinin küçük resminin URL’sini almak için, özelleştirdiğiniz tema şablonuna kod eklemeniz gerekir. Daha fazla bilgi edinmek için WordPress’te özel kod ekleme hakkındaki kılavuzumuza bakın.

Eğer sadece yazının küçük resmini görüntülemek istiyorsanız, bu PHP kodunu WordPress döngüsü içinde üzerinde çalıştığınız şablona yapıştırabilirsiniz:

1
echo get_the_post_thumbnail(get_the_ID(),'medium');
Code Snippet to Display Post Thumbnail

Ancak gönderi küçük resmini kendi özel biçimlendirmenizi kullanarak görüntülemek veya temanızdaki küçük resmi başka bir şekilde kullanmak istediğiniz için gönderi küçük resmi URL’sini almanız gerekecektir.

Bunun yerine bu kodu şablona yapıştırmanız gerekecektir:

1
echo get_the_post_thumbnail_url(get_the_ID(),'medium');
Code Snippet to Display Post Thumbnail URL

Bu kod basitçe öne çıkan görselin URL’sini görüntüler. Daha sonra kodu, gönderi küçük resim URL’sini istediğiniz şekilde kullanacak şekilde özelleştirebilirsiniz.

Küçük resim boyutunu da özelleştirebilirsiniz. ‘Orta’ kelimesini ‘küçük resim’, ‘orta-büyük’, ‘büyük’ veya ‘tam’ gibi başka bir varsayılan resim boyutuyla değiştirmeniz gerekecektir.

Veya oluşturduğunuz herhangi bir ek görüntü boyutunu kullanabilirsiniz. Özel bir resim boyutu kullanırsanız, küçük resimleri yeniden oluşturduğunuzdan emin olun.

Umarız bu eğitim WordPress’te yazı küçük resmi URL’sini nasıl alacağınızı öğrenmenize yardımcı olmuştur. WordPresste alt sayfa oluşturma rehberimize veya WordPress için en iyi ilgili yazı eklentileri uzman seçimimize de göz atmak isteyebilirsiniz.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

17 yorumLeave a Reply

  1. Kiran

    I have designed a website using wordpress. Currently featured image is showing description section.

    But i want to show featured image url in rss feed.

    How to add featured image (media:thubnail) url in rss feed?

    Please help…

  2. Salim

    WP Beginner, your second wordpress codex!

  3. Mohan Krishna

    Your Site is giving awesome tips but i suggest you to provide demos of the respective codes how it looks like after making the changes as you said because users like me can have a look over that and find if it suits best or not also by the way your visitors can increase by double.

  4. TracyDempsey

    Hi there, I’m searching for how to manually get the URL, but keep finding posts with code for fetching the URL. I’m using Thesis, and I’ve used the WordPress image editor on some post images to create a cropped, square thumbnail image for my category pages’ excerpts/teasers. But, when I paste the image URL into Thesis’ thumbnail URL field, it doesn’t recognise the cropped thumbnail, but crops the original image (thereby skewing the aspect ratio). So I’m just trying to find the direct URL for the thumbnail of the source image – can you help?? Thanks in advance!

  5. Wynand

    I dont know if this is the correct page to post this, but what i would like to do is the following:

    I have many websites, I would like to display a thumbnail of each in a wordpress page, by just adding the url to that page, or some code surrounding the url

    Can anybody help

  6. pipo gorosito

    Dude, I love you

  7. Kevin Donnigan

    Awesome!! Thanks for this :-) Needed it for a custom loop with a sticky post on top and set the background image.

  8. abhay

    Thank that help me a lot

  9. Thiago Miro

    Thanks, this solved a big problem.

  10. Luís Fernando Guedes

    Thanks for sharing!

  11. Nicola

    Thanks for writing this tutorial, i don’t know why but the code you wrote never worked for me, and i know it is even available in the codex, i tried it with several loop configurations but no luck.

    Recently i managed to make it work by using it in conjunction with another function: get_post_thumbnail_id()

    ID ) );
    ?>
    <img src="” alt=”” />

  12. Josh

    Really great article. Thanks.

  13. Jotpreet Singh

    Hey, Syed. Good that it’s a turn away from using plugins all the time. Well, Cheers to that

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.