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

WordPress 3.1’de Yazı Biçimlerinin Neleri, Nedenleri ve Nasıl Yapılırları

Yazı formatları WordPress 3.1 ile gelen heyecan verici özelliklerden biridir. Ancak yeni başlayanların çoğu yazı formatlarının ne olduğu, sizin için neden önemli olduğu ve bu harika özellikten nasıl yararlanabileceğiniz konusunda hiçbir fikre sahip değil. WordPress 3.1’in alfa sürümünü inceledikten sonra, WordPress 3.1’de gelen Yazı biçimleri özelliğinin ne olduğunu, nedenlerini ve nasıl yapılacağını açıklamaya karar verdik.

Gönderi Biçimleri Nedir?

Gönderi Biçimleri, bir gönderinin sunumunu özelleştirmek için temalar tarafından kullanılabilen meta bilgilerdir. Tamam, şimdi düz İngilizce olarak gönderi formatı belirli bir gönderiyi şekillendirmenin bir yöntemidir. Bu özelliği kullanarak, belirli bir yazının görüntülenme “biçimini” belirleyebilirsiniz. Bu özellik WordPress’in mikro blog özelliğini genişletir çünkü artık video, bağlantı, resim, ses, alıntı, durum vb. öğeleri tek bir yerde toplayabilirsiniz ve en iyi yanı da bunların uygun şekilde şekillendirilecek olmasıdır.

Kullanım Örnekleri

Digging into WordPress resmi bloguna bir göz atalım. Ana sayfada iki tür yazı stilleri var. Biri, diğer bloglarda olduğu gibi bir alıntının görüntülendiği tam bir gönderi. Ancak ilginç olan, okuyucuları için yararlı buldukları diğer blog yazılarına harici bağlantılar olan belirli bir yazı stiline sahip olmalarıdır.

Digging into WordPress Example Usage of Post Formats

Blog yazmak tamamen kaynak paylaşmakla ilgilidir ve çoğu zaman blog yazarının okuyucuları için faydalı bulduğu için harici bir kaynağa bağlantı vermek istediği durumlar olur. Karşılaştıkları temel sorun, okuyuculara başka bir siteye gitmelerini söylemek için yeni bir gönderi yapmak zorunda olmalarıdır. Bu da son kullanıcı için kafa karışıklığı yaratır çünkü ne tür bir gönderi olduğunu bilemezler. Çoğu zaman kullanıcı, yazarın kendisinden harici bir bağlantıyı görüntülemesini istediğini öğrenmek için gönderinin tam görünümüne tıklamak zorunda kalır. Bunun gibi, yazı başlıklarından harici bağlantılara bağlantı vermenizi sağlayan hileler olsa da, bu yazı biçimi sorunu her şeyi çözecektir. Tema tasarımcıları, Jeff Starr’ın Digging into WordPress için yaptığı gibi “bağlantı biçimlerini” farklı bir şekilde görüntülenecek şekilde şekillendirebilirler.

Bu özelliğin gücü tarif edilemeyecek kadar fazla. Çünkü artık twitter’da yaptığınız gibi kısa durum mesajları yazabilir ve çok fazla uğraşmadan farklı bir şekilde şekillendirebilirsiniz. Beğendiğiniz bir alıntı bulduysanız, bunu paylaşabilir ve tek bir tıklamayla öne çıkmasını sağlayabilirsiniz. Sonuç olarak “yazı formatları” özelliği WordPress’i daha eksiksiz bir blog platformu haline getirecek.

Neden Posta Biçimlerini kullanmak istiyorsunuz?

Yazı formatları, benzer stil özelliklerini gerçekleştirmek için kategori kullanma ihtiyacının yerini alıyor. Şimdiye kadar, geliştiriciler bu etkiyi gerçekleştirmek için WordPress kategorilerini hacklediler ve bu da yeni blog yazarları için çok fazla dağınıklık ve kafa karışıklığı yarattı. Yazı formatlarını kullanmak yalnızca kategoriler açısından karmaşayı azaltmakla kalmayacak, blogunuzu bu formatları destekleyen temalar arasında taşınabilir hale getirecektir.

Ayrıca blogunuzu okuyucularınız için daha kullanıcı dostu hale getirecektir çünkü kullanıcınız tam olarak ne tür bir yazı görüntülediğini bilecektir. Ayrıca, blog sayfanızda farklı tarzda yazılara sahip olacağınız için blogunuzu daha canlı hale getirecektir. Şu anda, çoğu blog gönderisi ekranı çok sıkıcı görünüyor çünkü tüm gönderiler birbirine benziyor. Yazı formatları WordPress destekli sitelerde çok ihtiyaç duyulan bir boşluğu dolduracaktır.

WordPress 3.1’de Yazı Biçimleri Nasıl Eklenir ve Kullanılır

Tıpkı yazı küçük resimleri, Menüler, Özel Arka Planlar ve Özel başlıklar gibi, yazı biçimleri de tema tarafından etkinleştirilen bir özellik olacaktır. Bunun anlamı, bu özelliğin yalnızca temanız uyumluysa kullanılabilir olacağıdır.

Uyarı: Bu eğitimi takip edebilmeniz için HTML, CSS ve WordPress döngüsünün işlevlerini iyi derecede anlamış olmanız gerekmektedir.

WordPress 3.1’de “yazı biçimlerini” etkinleştirmek için temanızın functions.php dosyasını açmanız ve aşağıdaki kodu yapıştırmanız gerekecektir:

add_theme_support( 'post-formats', array( 'aside', 'gallery' ) );

Not: aside ve galeri mevcut tek gönderi biçimleri değildir. Kullanılabilir gönderi biçimleri listesi şunlardır:

  • kenara – Genellikle başlıksız olarak şekillendirilir. Facebook durum güncellemesine benzer.
  • chat – Bir sohbet transkripti.
  • gallery – Bir resim galerisi.
  • link – Başka bir siteye bağlantı.
  • resim – Tek bir resim.
  • alıntı – Bir alıntı.
  • status – Genellikle 140 karakterle sınırlı kısa bir durum güncellemesi. Twitter durum güncellemesine benzer.
  • video – Tek bir video.

Yazı biçimlerinin tam listesi için WordPress Codex‘e bakın.

Bu kodu ekledikten sonra, yazı yazma panelinizde sağ sütunda yayınla yazan yerde yeni bir alan göreceksiniz.

Post Format Option in Post Write Panel

Gönderiyi yazdıktan sonra biçimi değiştirebilir ve yayınla düğmesine basabilirsiniz. Bu, gönderinizi önceden şekillendirilmiş bir biçimde görüntülemenizi sağlayacaktır.

Ancak bekleyin, bu önceden şekillendirilmiş yazı formatlarını henüz temamızın herhangi bir yerinde belirtmedik. Yani şu anda, WordPress yazı panelinizde formatı seçseniz bile, temanız nasıl görüntüleneceğini bilmediği için bir fark yaratmayacaktır. Bunun için yazı döngümüzü düzenlememiz gerekecek.

Koşullu etiketi kullanacağız: has_post_format()

if ( has_post_format( 'aside' )) {
  // code to display the aside format post here
} else if (has_post_format('gallery')) {
   // stuff to display the gallery format post here
} else if (has_post_format('link')) {
   // stuff to display the link format post here
}else {
   // code to display the normal format post here
}

Şimdi ne bekliyorsunuz? Kendinizi bu harika özellik için hazırlamaya başlayın. Bu özelliği kullanarak ortaya çıkacak yeni temalarla WordPress’in bir mikro blog platformu olarak giderek daha fazla kullanılacağını hayal edebiliyoruz.

Ek Okumalar:

WordPress Codex Yazı Biçimleri
Gönderi türleri ve biçimleri ve taksonomiler, aman Tanrım!
Gönderi Biçimleri ve Özel Gönderi Türleri

Açıklama: İçeriğimiz okuyucu desteklidir. Bu, bazı bağlantılarımıza tıklarsanız komisyon kazanabileceğimiz anlamına gelir. WPBeginner'ın nasıl finanse edildiğini, neden önemli olduğunu ve nasıl destek olabileceğinizi görün. İşte editoryal sürecimiz.

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.

Ultimate WordPress Araç Kiti

Araç setimize ÜCRETSİZ erişim sağlayın - her profesyonelin sahip olması gereken WordPress ile ilgili ürün ve kaynaklardan oluşan bir koleksiyon!

Reader Interactions

24 yorumBir Cevap Bırakın

  1. Syed Balkhi

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Rahul

    if ( has_post_format( ‘aside’ )) {
    // code to display the aside format post here
    } else if (has_post_format(‘gallery’)) {
    // stuff to display the gallery format post here
    } else if (has_post_format(‘link’)) {
    // stuff to display the link format post here
    }else {
    // code to display the normal format post here
    }
    Where do we have to add this code. Thanks in advance . Inside Index.php or somewhere else.

  3. saurabh

    Now making categories as galleries is really simple.

  4. Keely

    Where exactly is this chuck of code added?
    I can’t find a thing about this anywhere; not being a php programmer I don’t know where to put it.

    • Editorial Staff

      The code shown in the post which utilizes has_post_format() is what you will put inside your loop to give each post a specific styling.

      Yönetici

  5. Dave

    It looks like your code is missing a closing bracket in the first line. It currently reads:

    if ( has_post_format( ‘aside’ ) {

    but it should be:

    if ( has_post_format( ‘aside’ )) {

    Great tutorial as always.

  6. Tom

    So, OK I am still a little confused about a few concepts here…can somebody please help me out? I apologize in advance for the crazy length of this post but I am new to WP ;)

    I understand the concept of posts, pages, categories and tags – that’s easy.

    As I now understand, the new feature of “post formats” (WP v3.1) relates to the styling of a “post” (think: “blog post”), whereas the concept of “post types” really means one of the five default WP “content types” (post, page, attachment, revisions, nav menus – see (http://codex.wordpress.org/Post_Types).
    Likewise, the new feature of “custom post types” (WP v3.0) relates to creating *new* “post types” (outside of posts, pages, etc.), what ever that might be.

    WOW…that sounds understandable in…t h e o r y.

    OK, I DO get the new “post format” in theory…but I am a visual type of learner, so I wanted to see what they could look like.

    So your example of the ‘link’ “post format” post at Digwp.com was good, but I also checked out some other themes, like: http://demo.themify.me/#theme=wumblr
    (side note here: confusing! – see how they refer to post formats as exactly that here: http://themify.me/themes/wumblr > Features… but at the top of that same page they call them “post types”).

    Anyhow…before I get to the “post types” feature of WP, I have a few questions about the “post formats” feature:

    1. Let’s say I want to make use of new “post formats” in an existing theme; I add these 10 different post formats in WP and specify them in the theme (as per your instructions). But then what..? How does the actual *DESIGN* for each of those post formats come about on the site?
    Is it likely that most theme developers (mostly for the paid-for ones) will update their themes (the coding part, plus the actual design of the “post format” part) – or should users wait for new themes to hit the market that offer this for the first time?

    What about theme frameworks – do we know of any that already offer child themes with the post formats feature incorporated? Some theme frameworks allow you to create (or radically customize) your own child themes based on a basic version, with not much or no coding involved…do we know if any providers have this level of customization already implemented?

    2. When I look at some of the themes that already use “post formats” (see: http://themify.me/demo/#theme=wumblr) – what I notice is that *some* of the category names of the individual post formats match the names in the list of standardized formats (see: http://codex.wordpress.org/Post_Formats#Supported_Formats) – but some don’t! The following names that the Wumblr theme uses are not on that list: ‘general’ and ‘notes’- while ‘aside’ and ‘gallery’ are on the list but not chosen category names for any of Wumblr’s new format type posts. So this leads me to ask…

    Compared to the usual practice of freely choosing names for categories (often for SEO purposes), what are the rules for naming categories for “post format” posts? Do they HAVE to match the names on the list of standard “post formats”? If not, how would that change the code you suggested in your article, following where you say: “We are going to be utilizing the conditional tag: has_post_format() …”? If you DID use names in that code that differ from the standardized list, would that not go against the rule of standardization and make it difficult to switch themes?

    I also wonder if by categorizing “post format” type posts by choosing names like: ‘link’ or ‘status’ or ‘quote’ for instance…how can anyone expect people to actively CHOOSE to click categories with THESE names, rather than posts that typically carry category names *describing their content*!!????

    With ‘video’ and ‘image’ and ‘gallery’ … I could still understand that people might actively and out of curiosity click those to be shown a list of all the posts with that type of content, but link, status, quote….?

    ~~So does anyone understand how all of this works?~~

    So I make it VERY short with my question on “POST TYPES” or more precisely “custom post types”:

    Where do THEY fit in here? I understand they are NOT the “blog post” type posts we are talking…but “custom” (=any type of content type BUT a post).

    ARE there already any themes having them implemented, and if so, can someone point me to some examples?
    ARE they handled by the theme or by a plugin?

    Thanks for your replies!!

    Tom ;)

    • Editorial Staff

      Hey Tom,

      Lets take a stab at your long question, one by one.

      Wumblr Theme by Themify was released before WordPress 3.1 (so note, they did not have Post Formats at that time). So they called them whatever they liked, in this case post types”. Which again is a conflicting vocabulary, we recommend that it should be called Content Types because the whole idea of post types is to be NOT posts, RIGHT? Anyways so I think you are confused because of the semantics that Wumblr used. Again you mentioned later on why Wumblr has its own custom post formats rather than the supported formats. Because it was released before Post Formats were available, so they went with what they thought should be good.

      You would have to specify in your theme’s CSS that if a post format “XXX” is called then add these styles. A good way to do this would be getting the themes that already support Post Formats and look how they do it. Or simply open your browser’s Source and you will see the default class that is added. Most frameworks will be compatible with Post Formats in their coming versions however not all child themes will be compatible. It is very likely that some theme developers may go back and add post formats to their old themes. But we can’t say for sure which ones will do that and which ones won’t. There are a lot of new themes that are already hitting the market. Woo Themes has some, Themify has some. StudioPress will be releasing their own very soon as well. So it is really up to you if you want to wait or not.

      Your category name does not have to match post formats. Post Formats, and categories are two separate taxonomies. You are free to name your category whatever you like.

      Custom Post (Content) Types and Custom Post Formats are two separate beasts. One is a custom taxonomy while other is a custom content type. They serve two separate purposes. Taxonomies are to make organizing and display of content types easier. Custom Post Formats are taxonomies and Post is a content type.

      Both Custom Post Types and Post Formats are handled by themes. However for Custom Post Types there are plugins that make your life easier. You can refer to our article about custom post types on this site that will show you the plugins.

      Yönetici

  7. Tony

    I’ve been creating posts using custom post types when it should’be been a post format.

  8. ms-studio

    My big question is: can we customize the write/edit page for those post types?

    If yes, that would be a compelling reason to start using them immediately. Any pointers as how to do that would be appreciated, as http://codex.wordpress.org/Function_Reference/add_meta_box doesn’t give any clues.

    If not, Custom Post Types will be much more useful.

    • Editorial Staff

      That page in the codex explains it all. It shows that they are adding this meta box to the custom content type “post” and “pages”… They are adding the input fields, and they are saving it. Use that information, and build on top of it.

      Yönetici

  9. Connor Crosby

    If you download the WP 3.1 beta, the Twenty Ten theme supports aside and gallery.

  10. Phaethon

    Awesome. We’ll be able to add more style hooks to the loop outside of the official WP 3.1 post types too, right?

  11. Connor Crosby

    Do you know possibly when 3.1 might be available for the public? I was actually just looking how to create a link style like digwp.

    • Editorial Staff

      WordPress 3.1 is set to be launched right before the holidays so around Mid December would be a fair date.

      Yönetici

  12. Barbara Ling

    Beyond awesome, this will be quite the killer feature indeed! Sharing this with my network this instant, thanks!

  13. Pippin

    This is awesome. Nothing that really enhances things from a developer’s perspective, but this will be great for end users.

  14. Bjorn van der Neut

    So if I understand correctly its a little bit the same as copy the page.php to gallery.php modify it and in the page select as template “Gallery”.

    Only now its going to be not on page level but on post level?

      • Bjorn van der Neut

        Ok thanks! I use the plugin Impact (Payed version) for this functionality right now. I am also bussy with Genesis but I did not find that option at this moment.

        • Editorial Staff

          This option will come available in WordPress 3.1. It is not available yet.

Bir Cevap Bırakın

Yorum bırakmayı seçtiğiniz için teşekkür ederiz. Lütfen tüm yorumların yorum poli̇ti̇kasi uyarınca denetlendiğini ve e-posta adresinizin yayımlanmayacağını unutmayın. Ad alanında anahtar kelime KULLANMAYIN. Kişisel ve anlamlı bir sohbet edelim.