go41

Re: Random Post :: Reply by Joern

von Joern am 6. Mai. 2011 | Keine Kommentare

about the position: the div is anyway positioned inside the div around, here div id="top"
this has nothing to do with screen resolution as top is 930px wide in all cases and featured takes 320px aligned to the right (float:right) in there.
The query:

actually you have two queries in random posts (the one you gave above)

first you get 12 (or 9) of all posts randomly, regardless of an image in there or not:
$randompost = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE post_status = ‚publish‘ AND post_type = ‚post‘ ORDER BY RAND() LIMIT 12");
the second query gets only posts with an image and shows only the ones with this ‚values‘:
$values = $wpdb->get_var("SELECT meta_value FROM $wpdb->postmeta WHERE post_id = $ID AND meta_key = ‚Image‘
so if the first query contains post with no image, there will be nothing displayed.
Solution: Try to get only posts with a meta_key = ‚Image‘ in the first step, could look like this for the first query:
$randompost = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE post_status = ‚publish‘ AND post_type = ‚post‘ AND meta_key = ‚Image‘ ORDER BY RAND() LIMIT 9");
I did not test, but should do the trick…
Thumbnail loading: for small thumbnails I would set the image quality to 70.

find this line in the random posts part:

echo $values; ?>&w=<?php echo $width; ?>&h=<?php echo $height; ?>&zc=1&q=100"
and change just q=100 to q=70 at the end.
you will get a smaller file size, it might help.
I think you scripts folder is set to 755 or 777, most servers prefer 644 for this and 755 or 777 only for the cache folder for thumbnails
good luck
____________________
you find me on Google+, Twitter and Facebook

(von: Joern)

Hier noch 9 weitere Ergebnisse dieses Threads:

Random Post

5. Mai. 2011 (von: saber210)

Hello Joern,I need your help.. I just found out this code on arthemia premium and it works well on arthemia free..I just want to customize it a little more.. I tried to edit the code all by myself but I…

Re: Random Post :: Reply by Joern

5. Mai. 2011 (von: Joern)

can't see it on your site in the moment.First I would try to set in this line:Code:$randompost = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY RAND() LIMIT 12");the LIMIT to 18Code:$randompost = $wpdb->get_results("SELECT…

Re: Random Post :: Reply by Joern

5. Mai. 2011 (von: Joern)

Oh, I think you have the random posts in the featured section?One hint, uncomment in style.css near line 390 the position: absolute; and left: 780px;like this:#featured { float: right; font-size: 12px;/* left: 780px; */ padding: 5px 5px 0 1... Weiterlesen…

Re: Random Post :: Reply by saber210

6. Mai. 2011 (von: saber210)

Thanks Joern, I got it working now..I just want to ask about absolute position.. Will this work on any screen resolution? I dont want it to overlap when view on other screen resolutions..And one other thing, the limit on sql…

Re: Random Post :: Reply by saber210

7. Mai. 2011 (von: saber210)

Thanks Joern,But the code seems dont work.. I tried it once and no random post showed up..Another thing, I want to remove the thumbnail on single post and replace it with whole picture? is that possible? Weiterlesen →

Re: Random Post :: Reply by Joern

7. Mai. 2011 (von: Joern)

In your Arthemia Premium Dashboard you should have a page for theme options.Find 'Single Post Page Settings' and set here the thumbnail size to a bigger value like 550px wide and 550px highAnother way is to select the option not…

Re: Random Post :: Reply by saber210

7. Mai. 2011 (von: saber210)

Thanks admin.. how about doubling the category bar? In arthemia free it is very easy but in arthemia premium i think it is hard..Code:<?php $showcatbar1 = get_settings ( "cp_showpostcatbar" );            $showcatbar2 = get_settings ( "cp_showarchivecatbar"…

Re: Random Post :: Reply by Joern

7. Mai. 2011 (von: Joern)

right, this part in header.php generates the category bar in index, archive or post, whatever you select.Important here is $postcat = get_settings( "ar_categories" )means the theme get's the categories from the options settings in your dashboard.The admin menu you see…

Re: Random Post :: Reply by saber210

8. Mai. 2011 (von: saber210)

Thanks admin.. but it doesnt work..EDIT: i found a solution on this line Code:$postcat = array_slice($postcat, 0, 5);sort($postcat);I just change 5 to 10 and it works..Thanks again admin! Weiterlesen →

wichtig:

  • arthemia random posts

Autor:

Du findest mich auch auf Google+, Twitter und Facebook!

Schreibe einen Kommentar

Pflichtfelder sind mit * markiert.


weitere forum Beiträge: