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

WP-PostRatings ile WordPress’e Yazı Derecelendirme Sistemi Ekleme

Editoryal Not: WPBeginner üzerindeki ortak bağlantılardan komisyon kazanıyoruz. Komisyonlar, editörlerimizin görüşlerini veya değerlendirmelerini etkilemez. Editoryal Süreç hakkında daha fazla bilgi edinin.

Yakın zamanda projemize basit bir yazı derecelendirme sistemi dahil etmek istiyorduk ve çok sayıda eklentiyle uğraşmak zorunda kaldık. Birkaç tanesini inceledikten sonra, WordPress’e bir yazı derecelendirme sistemi eklemek için en iyi çalışanın Lester ‘GaMerZ’ Chan tarafından yazılan“WP-PostRatings” olduğunu gördük. Bu makalede, WordPress blog yazılarınız ve sayfalarınız için bir AJAX derecelendirme sistemi kurma konusunda size yol göstereceğiz.

Video Eğitimi

Subscribe to WPBeginner

Videoyu beğenmediyseniz veya daha fazla talimata ihtiyacınız varsa, okumaya devam edin.

Öncelikle WP-PostRatings Eklentisini indirmeniz ve etkinleştirmeniz gerekir (Yeni başlayanlar için: Adım Adım WordPress Eklentisi Kurma Kılavuzu)

Etkinleştirmenin ardından, eklenti WordPress yönetici çubuğunuza ‘Derecelendirmeler’ etiketli yeni bir menü öğesi ekleyecektir.

“Yönetilen Derecelendirmeler” seçeneğini atlayacağız ve “Derecelendirme Seçenekleri” adlı sekmedeki ikinci bağlantıyla başlayacağız.

WP Post Ratings settings page

Eklentinin ayarlar sayfasında, öncelikle yazılarınız için hangi derecelendirme görselini kullanmak istediğinizi seçmeniz gerekir. Eklenti çubuklar, kalp, sayılar, artı-eksi, klasik yıldızlar, başparmak yukarı/aşağı, yukarı-aşağı oklar vb. gibi bir dizi seçenekle birlikte gelir.

Beğendiğiniz derecelendirme sistemini seçtikten sonra, “Maksimum Derecelendirme” değerini seçebilirsiniz. Eklenti sizin için uygun bir değer seçecektir, ancak çubuk resmi kullanırken kendi derecelendirme değerinizi belirtmek isteyebilirsiniz. Yıldızlar ve sayılar için 5’in üzerine çıkmak anlamsız görünüyor çünkü sadece 5 yıldız var.

Unutmayın, eğer Maksimum Derecelendirmeleri ayarlarsanız, Bireysel Derecelendirme Metnini/Değerini de ayarlamanız gerekecektir. Maksimum Derecelendirme değerini varsayılandan değiştirmezseniz, Bireysel derecelendirmeleri de varsayılan olarak bırakın.

Ardından Ajax Stili, Derecelendirme İzni ve Günlüğe Kaydetme Yöntemi seçeneklerini göreceksiniz.

Ratings Ajax Style and logging method

En iyi sonuçlar için yukarıdaki görselde yer alan stilleri takip edebilirsiniz. Ancak özelleştirmek isterseniz bunları değiştirmeniz gerekebilir.

Bu sayfa ile işimiz bitti, değişiklikleri kaydedin. “Derecelendirme Şablonları” sayfasına geçelim. Bu sayfada farklı derecelendirme şablonlarını ve bunları nasıl düzenlemek istediğinizi göreceksiniz. Biz bunları varsayılan değerde bıraktık, ancak bunları değiştirmek için ekranın üst kısmındaki Şablon Değişkenlerini kullanabilirsiniz. Bu temel olarak derecelendirmelerinizin nasıl görüntüleneceğini göstermek içindir. “Derecelendirme Şablonları” sayfasını tamamladığınızda, bunu temanıza eklemeye hazırsınız demektir.

Temanızın nasıl kurulduğuna bağlı olarak, aşağıdaki dosyalarda (archives.php, page.php, index.php, single.php, loop.php vb) LOOP içinde aşağıdaki kodları eklemeniz gerekecektir – Yapıya bağlı olarak temanızda bu dosyaların hepsi olmayabilir.

<?php if(function_exists('the_ratings')) { the_ratings(); } ?>

Bu işlemin, gönderi derecelendirmesini tüm gönderilere ekleyeceğini unutmayın. Bunu yalnızca seçili gönderilerde kullanmak istiyorsanız, derecelendirmeleri yalnızca o gönderide veya sayfada görüntülemek için [ratings id=”1″ results=”true”] kısa kodunu kullanabilirsiniz.

Artık derecelendirme eklediğinize göre, kullanıcılarınız gönderilerinizi oylayacaktır. Başlangıçta atladığımız “Derecelendirmeleri Yönet” seçeneğinden bu derecelendirmeleri görüntüleyebilirsiniz. Bu, her bir gönderideki derecelendirmelerin günlüğünü görmenizi sağlar ve yanlış bir şey olduğunu düşünüyorsanız bunları silebilirsiniz.

Bu eklentinin en iyi yanı, En Yüksek Puanlı Gönderileri (zaman aralığı ve kategori seçeneği), En Çok Puanlanan Gönderileri (zaman aralığı ve kategori seçeneği), En Düşük Puanı ve En Yüksek puanı aynı zaman aralığı ve kategori seçeneği ile gösterme yeteneğine sahip olmasıdır. Çoğu zaman, bu tür istatistikler kenar çubuğuna eklenir, bu nedenle bu eklenti bunları görüntülemek için Widget’ları kullanmanıza izin verir (yalnızca temanız widget’ları destekliyorsa – Çoğu YAPAR!). Basitçe Görünüm ” Widget’lar bölümüne gidin ve Reytingler widget’ını bulun. Uygun konuma sürükleyin ve istediğiniz ayarları yapın.

Ratings widget options

Şimdi yukarıdaki ekran görüntüsünde dikkat ederseniz, bir sürü seçenek var. Birincisi, widget’ınızın başlığını seçmektir. “Bu Hafta En Çok Oy Alan Gönderiler” gibi bir şey seçmek en iyisidir. Ayarlarınızın geri kalanını nasıl yaptığınıza bağlı olarak. İstatistik Türü alanında En Yüksek Puan, En Çok Puan, En Düşük Puan ve En Yüksek Puanı göstermenize olanak tanıyan tonlarca seçenek vardır. Ayrıca bu istatistikleri kategoriye veya zamana göre seçme seçeneğiniz de var. Bir sonraki seçenek, hem gönderilerinizi hem de sayfalarınızı dahil etmek isteyip istemediğinizi sorar. Bu tamamen kişisel bir seçimdir. Yani istediğiniz gibi seçin. Widget varsayılan olarak en popüler 10 girişi gösterir, ancak Gösterilecek Kayıt Sayısı düzenlenerek değiştirilebilir. Bunu 10’dan fazla yapmamanızı şiddetle tavsiye ederiz çünkü çoğu tasarımda tuhaf görünür. Bir gönderinin bu listeye girebilmesi için sahip olması gereken minimum oy sayısını da ayarlayabilirsiniz. Sitenizin tasarımına bağlı olarak Maksimum Yazı Başlığı uzunluğunu ayarlamak isteyebilir veya istemeyebilirsiniz. Tema konumunuz yeterince genişse, devre dışı bırakmak için değeri 0 olarak ayarlamanızı öneririz. Kategoriye veya Zamana özel istatistik türünü kullanıyorsanız, son iki alanı değiştirmeniz gerekir. Tıklayın ve kaydedin, işlem tamamdır.

Bazılarınızın kod bağımlısı olduğunu ve widget ayarlarını kullanmak istemediğini biliyoruz. Lester, sitesinde en çok puan alan, en yüksek puan alan vb. öğeleri doğrudan WordPress Temalarınıza nasıl ekleyeceğinizi açıklayan çok ayrıntılı bir Kullanım Sekmesi derledi. WP-PostRatings Kullanım Kılavuzuna bakın.

Umarız bu makale WordPress sitenize bir yazı derecelendirme sistemi eklemenize yardımcı olmuştur. WordPress’te yazı tepkileriyle okuyucuların ilgisini nasıl çekebileceğinize ilişkin kılavuzumuza da göz atmak isteyebilirsiniz.

Bu makaleyi beğendiyseniz, WordPress video eğitimleri için lütfen YouTube Kanalımıza abone olun. Bizi Twitter ve Facebook‘ta da bulabilirsiniz.

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

53 yorumBir Cevap Bırakın

  1. Syed Balkhi says

    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. Kyle says

    Hi I am very new to WP and can’t seem to figure out how to add the code to the LOOP in archives.php, page.php, index.php, single.php, loop.php etc. Can you please provide a little guidance?
    Thank you

    • WPBeginner Support says

      If you reach out to your specific theme’s support they should be able to assist with locating the loop in your theme.

      Yönetici

  3. Ivan says

    Hi, is there a option to rate with a ‘half star’ ?, i saw there is a picture showing ‘half star’ , thanks

    • WPBeginner Support says

      You can create custom icons if you want but the half stars are normally for the average for the rating

      Yönetici

  4. Shoaib Saleem says

    Hi,
    How to get top rated posts in WordPress? I am using custom code to rate post with comments. The rating value is storing in comment meta table.I need help to get 5 top rated posts.
    Thanks

  5. Radu Giurgiu says

    Hello!

    It is a good general information about this rating plugin, with is good.
    But… what happen if the user what to re-star (rating) the post?
    Seems the plugin not allowing tho let the user change his opinion about a specific post. Wich is very important.

    There is a solution for that?

  6. Riyaz Shaikh says

    Thank you for sharing this article. Was of great help, I was struglling with this since months, but and today could install Rating plug in on webpage.

    Thanks to you

  7. Umang says

    We have recently implemented the rating plugin on our company’s blog posts and it is work like a charm.

    Google Rich Snippets setting is also a great option but I think it should be enabled by default.

    Thanks for sharing such a useful plugin.

  8. Gobind Singh says

    I’m trying to run that plugin in local server. The stars have shown up in my post but I’m not able to do rating. How can I solve this problem? Please help me..

  9. Gail Palubiak says

    It sounds interesting but I found your explanation inadequate.

    “Depending on how your theme is setup, you will need to add the following codes within the LOOP in the following files (archives.php, page.php, index.php, single.php, loop.php etc) – You may not have all of these files in your theme depending on the structure.”

    Most information please.

  10. surya JD says

    hey thanks but as I know this plugin won’t work with any cache plugin.
    But on your blog you are using this plugin with w3 total cache . right ?
    what tricks you used to work this plugin with cache plugins…

  11. Mathias says

    Could you guys please help me??? I don’t get that plugin to sort posts by rating on my homepage… I’m a total beginner in coding… where exactly do I have to put which lines of code to sort my posts by rating??? Please help me!

  12. Mike Antkowiak says

    Hey there great tutorial. I am using this plugin and I want to apply it to custom post types. Is there a way to add custom post types to the widget display?
    Thanks for you time.

    • surya JD says

      yes If you created post template for custom post type aka CPT you can add
      in post loop.
      if you already don’t have custom template for CPT you can create in your theme folder or in child theme of main theme.

  13. salem says

    Hi
    Is their way to make plug-in files load from the theme
    I the my Site using Firebug Ysalow and find the loading.gif take long time to loading .

  14. R Thorp says

    Thankyou! Solid advice, easy to folow guidance! However it would have been better if you included a little bit about adding the codes into the loop files, as i had to refer to other websites to find this.
    Cheers

  15. Shady M Rasmy says

    i know its on old post and i don’t think i will get a reply on it
    but i will ask any way :D
    is there a way to collect the costume filed data for each user to show it in a page
    for logged in user
    example what i mean
    if i voted this post up
    and other posts
    can i show those posts later from page my likes for example ?
    sorry bad English :)

  16. wpbeginner says

    There must be some issue with how the plugin is entering the code. You can always disable the normal integration, and paste the code directly in your template.

  17. Anna747 says

    I added the codes to the files listed but the ratings were showing up at the bottom of my page below the footer instead of below the post? I only want them below the post, not on my pages/homepage…and right below the post.

    • arbitrarylifestyle says

      You’d want to find out the specific place you want the ratings to show up. For example, mine show up just beside the title so I put my code next to the title as so:

      Yeah!!!

  18. Shad says

    Awhile back I was conceptualizing a site for short-story authors. The member would submit a story(post) and the other members would critique the story (as comments).

    What I was looking for then, and what is similar to this post, is a way for the original author to select comments as helpful (as in an thumbs up with note that said “Author found this comment helpful”). Has anyone seen anything such as that? Where the actual comments are rated?

    • Auz says

      I am currently using GD Star Rating for our rating system. It has been very flexible, but probably a little more advanced than wp-postratings. It does have the ability to allow comment ratings. For an example check out our site (www.bendbeerblog.com)

      I eventually want to connect the ratings with the untappd.com API. I am hoping I can hook into the system, but if not I may have to write a custom solution.

  19. Keith Davis says

    Plugin looks great but I’m trying to cut down the number of plugins that I use.

    It’s all too easy to just keep adding plugins.

    Thanks for another great tut.

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.