![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Sep 2009
Location: Europe
Posts: 362
|
![]() I found this randomize plugin and it works great, but the problem is that it has an issue with the pages. When active it random the posts but when i click on a new page it does not move from page 1 to 2 etc. Anyone know how to fix that in this code?
![]() Code:
if(!get_option("post_randomize")) update_option("post_randomize","true"); function post_randomizer () { if (get_option("post_randomize")=="true") { if (is_home() || is_feed()) query_posts("orderby=rand"); } } function postrandomizer_widget_initial () { wp_add_dashboard_widget("Post Randomizer","Post Randomizer","postrandomizer_widget"); } function postrandomizer_widget() { global $wpdb; if ($_POST["postrandom"]<>"") {update_option("post_randomize","true");echo "<div class='updated fade'>Setting saved</div>";} if ($_POST["postunrandom"]<>"") {update_option("post_randomize","false");echo "<div class='updated fade'>Setting saved</div>";} $stat = get_option("post_randomize"); if ($stat=="true") $current="Randomized"; else $current = "Normal Order"; echo "Current Status: <div align='center'><h1>$current</h1> Randomize the displayed post on your homepage and on the feed. It will be useful for site or blog that not daily updated so when the visitor come stopping by on your homepage, he won't see same posts or contents twice. <a href='http://mr.hokya.com/post-randomizer/' target='_blank'>See more</a>"; echo "<p><form method='post'><input name='postrandom' type='submit' value='Randomize' class='button-primary'/><input name='postunrandom' type='submit' value='Do not Randomize' class='button-primary'/></form></p></div>"; } add_action('wp_dashboard_setup', 'postrandomizer_widget_initial'); add_action('get_header', 'post_randomizer'); add_action('atom_head', 'post_randomizer'); add_action('rss_head', 'post_randomizer'); add_action('rss2_head', 'post_randomizer'); ?> |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 | |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,359
|
Quote:
using query_posts is a bit outdated for this, what is the exact scope you are trying to do, cause this will do nothing for people actually visiting the site.
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Sep 2009
Location: Europe
Posts: 362
|
I was testing out plugins that would hopefully randomize x- posts from each categories once a day or on each reload. And this is no longer being updated thats why i posted it here, maybe it would be possible to get it working ...
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,359
|
you can run a filter on your posts so it loads them on random each load, let me know the full scope you want, every bit of info so i can code up and give it to you.
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |