31 Ekim 2008

Advanced Random Posts

WordPress Yorum Ekle

Advanced Random Posts Widget displays your posts by selecting randomly. It gets posts from selected categories or current category or all posts. When your visitors are at home, it gets posts from all posts or selected category. If you set 'Get posts from current category', when visitors see single post, widget lists posts in the same categories of single post or when visitors click a category link, it gets posts from current category. At now, plugin could display thumbnails of your posts. (sorry, my English is poor)

Installation

  1. Make sure you are running WordPress version 2.8 or better. It won't work with older versions. If you use older versions, please download "Advanced Random Posts v1.1".
  2. Download the zip file and extract the contents.
  3. Upload the 'advanced-random-posts' folder to your plugins directory (wp-content/plugins/).
  4. Activate the plugin through the 'plugins' page in WordPress.
  5. See 'Appearance'->'Widgets' to place it on your sidebar. Set the settings

If you don't use 'Widgets', add following codes in your 'sidebar.php' to place 'Random Posts' on your sidebar. Change the parameters as you want:

  1. <?php if (function_exists('yg_randomposts')) { ?>
  2.  <li><h2><?php echo 'Random Posts'; ?></h2>
  3.   <ul>
  4.     <?php
  5. $parameters = array(
  6.     'limit' => 10, //Number of posts to show
  7.     'excerpt' => 60,  //excerpt length (letters)
  8.     'actcat' => false, //get posts current category
  9.     'cats' => '5,6',  //Categories to get posts
  10.     'cusfield' => 'thumbnail', //custom field name of thumbnail image
  11.     'w' => 48,  //width
  12.     'h' => 48, //height
  13.     'firstimage' => true,  //get first image of post content
  14.     'atimage' => false, //get first attached image of post
  15.     'defimage' => 'http://www.yakupgovler.com/default.jpg' //default thumbnail image
  16. );
  17.     //print random posts
  18.     yg_randomposts($parameters);
  19.    ?>
  20.   </ul>
  21.  </li>
  22. <?php } ?>

FAQ

How can I set it to get posts from current category?
Select checkbox on widget's settings called 'Get posts from current category'.
I want to display only the posts in two categories.
You have to write their category's ids -seperated with a comma- to 'Categories to get posts' textbox.

Screenshots


Widget's screenshot in 'Apperance'->'Widgets'

Options

Widget's options allow you to change your random posts list displaying.
Title - Your random posts widget's title on your sidebar.
Number of posts to show - How many posts to display
Excerpt length (letters) - You know that
Thumbnail Custom Field Name - If you want to display the thumbnail of your posts via a custom field, write its name.
Height, Width - Images size.
Get first image of post - If you don't want to use custom field, plugin will get first image from your post content.
Get first attached image of post - Plugin gets first attached image of post.
Default image - If post has no image, plugin display this image. Ex: http://www.yakupgovler.com/default-image.png
Notice: If you use three options, plugin uses custom field image firstly. If the post has no custom field, it gets first image from content. At last it gets first attached image. I suggest not to use "Get first image of post" for performance. It queries much more.
Categories - Plugin gets posts in these categories. (Category IDs, separated by commas.)
Get posts from current category - Posts will be get from current category (single post's category or current category).

Changelog

= 2.2 =
* Added Russian Language Support
= 2.1 =
Fixed a bug. Thanks E.Ali
= 2.0 =
* Adding thumbnail image support
* Rewriten by using WordPress 2.8 Widget Class API
= 1.1 =
*Bug fixed, showing the same post id.
= Version 1.0 =
* Initial release version.

Support Language

* English
* Turkish
* Russian - Thanks Fatcow
Notice: If you translate it in your language, please let me know.

Download

Advanced Random Posts v2.2
Advanced Random Posts v1.1

My English Plugins

  1. Random Tags Cloud Widget: A fantastic widget to manage your tags cloud.
  2. Advanced Random Posts: It shows random posts from selected categories or current categories or all posts, it is very useful.
  3. Advanced Blogroll Widget: display your bookmarks as you want. You can customize your blogroll displaying.
  4. Comment Approved Notifier Plugin: sends an e-mail to your commenters when you approve their comments.

Bu yazının kısa bağlantısı http://www.yakupgovler.com/?p=416.

Yazılarımı RSS aboneliği ile takip edebilir, yeni yazılarıma kolaylıkla ulaşabilirsiniz. Bunun için ise RSS adresimi kullanabilirsiniz.


“Advanced Random Posts” yazısı için 34 Yorum

Bu yazıya yapılan yorumları dilerseniz, ( RSS 2.0 ) beslemesini kullanarak takibe alabilirsiniz.

  1. Advanced Random Posts Widget - WP Plugin Archive dedi ki:

    [...] Advanced Random Posts Widget von Yakup Gövler zeigt ein zufällig ausgewähltes Posting aus wählbaren [...]

  2. Eklentilerinizi WordPress Dizinine Taşıyın · Yakup Gövler'in Not Defteri dedi ki:

    [...] Advanced Random Posts 31.10.2008 [...]

  3. Alturo dedi ki:

    Hi

    I installed this plugin and it's not working fine in my blog, it shows the titles of the ramdom post but the links are wrong, all of these links are the current post link.

    Any tip?

    thanks in advance!

  4. Yakup Gövler dedi ki:

    Dear Alturo,
    Thank you very much. I fixed it as you see on my sidebar ('Random Posts'). Please, update it.

  5. New WordPress plugins - 01.11.2008 | WPStart.org - WordPress themes, plugins and news dedi ki:

    [...] Advanced Random Posts Display random posts from selected categories or current category or all posts. Release page [...]

  6. Alturo dedi ki:

    Thanks, using it.

  7. Ashwin dedi ki:

    Good Work and thanks for this great plugin. Why don't you remove ."\" alt=\"". $post_title , that way there would be no problem with xhtml validation.

  8. Don-Jai : โดนใจ | [WP] Advanced Random Posts Plugin for Wordpress dedi ki:

    [...] หลังจากที่พยายามมานานในเรื่องการหาปลั๊กอินในการ Random Post ในที่สุดก็ประสบความสำเร็จซักที จริงๆ แล้วมีปลั๊กอินหลายตัวที่น่าใช้มากๆ แต่หลังจากที่ออฟได้ลองลงและลองใช้ก็พบว่าตัวนี้เป็นตัวที่” ใช่ “ที่สุด โดยเฉพาะสำหรับบล็อกของออฟที่ Theme ไม่สนับสนุน Widget ปลั๊กอินตัวนี้ชื่อว่า Advanced Random Posts v1.1 [...]

  9. joels dedi ki:

    nice plugin, i just installed and working well... thank you!

  10. Advanced Blogroll Widget · Yakup Gövler'in Not Defteri dedi ki:

    [...] Advanced Random Posts: It shows random posts from selected categories or current categories or all posts, it is very useful. [...]

  11. Comment Approved Notifier Plugin v1.1 · Yakup Gövler'in Not Defteri dedi ki:

    [...] Advanced Random Posts: It shows random posts from selected categories or current categories or all posts, it is very useful. [...]

  12. Meine Wordpress Plugins » MiFuPa.de dedi ki:

    [...] Advanced Random Posts -> für die Verwandten Blogeinträge [...]

  13. Levani dedi ki:

    Good job! Thanks.

  14. Website-Relaunch #03: Die besten Wordpress-Plugins – Update. : JUICEDblog dedi ki:

    [...] Advanced Random Posts (Version 1.1): Zeigt zufällig irgendwelche Artikel an (bis zu 20), widget-fähig. [...]

  15. Plugin: post e pagine casuali » jblog: news e appunti per webmaster dedi ki:

    [...] del plugin originale è Yakup [...]

  16. taylan dedi ki:

    Aradığım,fakat bulduklarımı beğenmediğim bir eklenti konusuydu. Widget olarak kullanılabilmesi ve ayar yapılabilmesi gerçekten mükemmel. Kullanıyoruum ve sorunsuz çalışıyor, teşekkürler.

  17. taylan dedi ki:

    Eklentiyi tema içinde veya yaratılmış bir sayfada nasıl gösterebilirim?

  18. Yakup Gövler dedi ki:

    Yazı içerisindeki
    yg_randomposts('limit=10&cats=3,6,8&currentcat=1');
    kodunu kullanarak kullanabilirsiniz. Örnek kodda 3. ve 6. kategoriden rastgele 10 tane yazıyı gösteriyor, ayrıca eğer bir kategori tıklanmışsa da sadece o kategorideki yazıları getiriyor.
    http://www.yakupgovler.com/?p=386 adresindeki açıklamaları okuyunuz, Türkçe bileşen için onu kullanınız.

  19. Olivier dedi ki:

    Hello,

    Great plugin but the posts choosen are always the same 🙁
    I use 2.7.1

  20. Bali Tours dedi ki:

    Hey, thank you for sharing. nice plugin, really useful for my blog. thank you very much.

  21. » Advanced Random Posts v1.1 · Yakup Gövler - WordPress'e dair ne varsa Wordpress Plugins: Just another WordPress weblog dedi ki:

    [...] View original post here: Advanced Random Posts v1.1 · Yakup Gövler - WordPress'e dair ne varsa [...]

  22. Annual Redesign Time | Randa Clay Design dedi ki:

    [...] Advanced Random Posts – after 2+ years of blogging there’s a lot of good content that can easily get buried. [...]

  23. Rastgele Yazı Eklentisi | Blog Blogu dedi ki:

    [...] böyle bir zamanda ulaştım Yakup Gövler‘in eklentisine. Eklenti için söylenecek çok fazla bir şey yok. Blogunuzdaki yazılar içerisinden istediğiniz [...]

  24. Bruno dedi ki:

    Working great with WP 2.71.

    Now, my theme has a function which returns the thumbnail of the first image of a post, e.g. getpostgk_img($post->ID). I gather it could be added somewhere to Line 111 of your plugin's Php file, where the $postlist string is being built. But where exactly? The best my experimentations have produced so far is the same thumbnail N times followed by the titles of the N random articles.

    Suggestions? 🙂

  25. Yakup Gövler dedi ki:

    You can do your codes by adding line 110 like the following if your function returns your images url:

    1. $post_title = htmlspecialchars(stripslashes($post->post_title));
    2. //your codes
    3. //for example
    4. //$image = getpostgk_img($post->ID);
    5. //Add $image => $postlist
    6. $postlist .= "<li>"."<img src=\"$image\" width=\"50\" height=\"50\" alt=\"$post_title\" title=\"$post_title\" class=\"randompostimg\" />";
    7. $postlist .= "<a href=\"" . get_permalink($post- rel="nofollow">id) . "\" title=\"". $post_title ."\" alt=\"". $post_title ."\">" . $post_title ."</a></li>\n";

    This code will show your image 50x50px size and you can customize it by "randompostimg" class identifier in your style.css, for example to add margin.

    If your function returns < *img src="your image url" /> you have to use the following codes.

    1. $postlist .= "<li>" . getpostgk_img($post->ID) . "<a href=\"" . get_permalink($post- rel="nofollow">id) . "\" title=\"". $post_title ."\" alt=\"". $post_title ."\">" . $post_title ."</a></li>\n";

    Please, let me know about results.

  26. Advanced Most Recent Posts - Yakup Gövler - WordPress'e dair ne varsa - Bileşen Eglish Eklentilerim WordPress WordPress 2.8 dedi ki:

    [...] Advanced Random Posts: It shows random posts from selected categories or current categories or all posts, it is very useful. [...]

  27. little-short dedi ki:

    hi, good job dude

  28. Recent Commented Posts dedi ki:

    [...] Advanced Random Posts: It shows random posts from selected categories or current categories or all posts, it is very useful. [...]

  29. Dennis dedi ki:

    Hi Yakup,
    is it possible, that the plugin show just the thumbnails without title and maybe two or three thumbnails in one line instead of just one? It should look like a small random thumbnail gallery in the sidebar.

    Cheers and greetings from germany!

    Dennis

  30. Yakup Gövler dedi ki:

    Hi Dennis,
    Thit is a good idea and It's possible but i am busy at todays so in next week i can add a choice not/to display title.
    Thanks.

  31. Dennis dedi ki:

    Hi Yakup,
    yeah that is a great news. Thank you very much!

    Dennis

  32. JG dedi ki:

    excellent plugin ... thank you for the time you spend working on it ! one suggestion : it would be nice to have an option for not posting article without thumbnail (posting the result with default image one thumbnail not related to the blog post is not useful ... and sometimes, your plugin doesn't find the image in the blog post)

  33. benedito gonzalez dedi ki:

    hello,
    i liked so much the plugins Advanced Most Recent Posts and Advanced Random Posts. But the only thing i would like you improve is the thumb layout. i think it`s better to complete the blank spaces. ( i made the print screen to show you ... http://img268.imageshack.us/i/image1nb.jpg/ )

    a tip, u can put like this other plugin
    http://alkivia.org/wordpress/sideposts or remove this blank space using the excerpt text.

    another tip is option to show the date of the post.

    i wait contact, thanks

  34. Pagerank potansiyeliniz linkleriniz ve gelecekteki PR derecenizin tahmini | Bitki Çiçek Sağlık Tasarım WordPress dedi ki:

    [...] http://www.yakupgovler.com/?p=416 [...]