Saturday, October 9, 2010

Fix random post images in Arthemia Premium

Buzz It
Previously I wrote a review on Arthemia Premium and told you why it is the best Professional wordpress theme, In this article I will tell you how to fix random post images in Arthemia Premium,The problem I have is that a lot of my older posts don’t, so I dont get twelve neat little thumbnails – in most cases I get less than twelve.so in this article I will tell you an easy way to fix it and get twelve neat thumbnails,

Note that this modification only works if you’re using the custom “Image” field to manage your thumbnails in Arthemia. If you’re using the “First Image” option, then this code won’t fix the problem.
Locate your “footer.php” file within your “arthemia-premium” theme, and change the code as follows at around line 24:

Note:Backup before making any changes

Original code:

get_results("SELECT ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY RAND() LIMIT 6");

foreach ($randompost as $post) {
$ID = $post->ID;
$postid = get_post($post->ID);
$title = $postid->post_title;
$values = $wpdb->get_var("SELECT meta_value FROM $wpdb->postmeta WHERE post_id = $ID AND meta_key = 'Image' ");
?>

etc ...
Replace it with the following code

get_results("SELECT ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY RAND() LIMIT 24");


$iCount = 0;
foreach ($randompost as $post) {
$ID = $post->ID;
$postid = get_post($post->ID);
$title = $postid->post_title;
$values = $wpdb->get_var("SELECT meta_value FROM $wpdb->postmeta WHERE post_id = $ID AND meta_key = 'Image' ");


if ($values != "") { $iCount += 1; }


if ($iCount == 13) { break; }
?>

Related Posts with Thumbnails

Leave a Comment

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

Recent posts


Recent Comments


  ©Template Blogger Elegance by Dicas Blogger.