![]() |
![]() |
![]() |
||||
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
Industry Role:
Join Date: Jul 2008
Location: In your back seat with duck tape
Posts: 4,568
|
![]() Ive been trying to add random post with thumbnail to a blog, but cant get it to work, cant find a plugin :
PHP Code:
![]()
__________________
High Performance Vps $10 Linode Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Jul 2008
Location: In your back seat with duck tape
Posts: 4,568
|
tried this no luck
Code:
<li><h3>Some Random posts</h3> <ul> <?php $posts = get_posts(?orderby=rand&numberposts=5′); foreach($posts as $post) { ?> <li><a href=?<?php the_permalink(); ?>? title=?<?php the_title(); ?>?><?php the_title(); ?></a> </li> <?php } ?> </ul> </li>
__________________
High Performance Vps $10 Linode Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
Confirmed User
Industry Role:
Join Date: Jul 2008
Location: In your back seat with duck tape
Posts: 4,568
|
Quote:
![]() ![]() ![]()
__________________
High Performance Vps $10 Linode Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Jul 2008
Location: In your back seat with duck tape
Posts: 4,568
|
can you enlighten me please
![]()
__________________
High Performance Vps $10 Linode Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Confirmed User
Industry Role:
Join Date: Jul 2008
Location: In your back seat with duck tape
Posts: 4,568
|
Quote:
![]() ![]()
__________________
High Performance Vps $10 Linode Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
♥♥♥ Likes Hugs ♥♥♥
Industry Role:
Join Date: Nov 2001
Location: /home
Posts: 15,841
|
Wordpress understands we all say things we don't mean when we're angry and it forgives you.
__________________
I like pie. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
Confirmed User
Industry Role:
Join Date: Apr 2011
Posts: 235
|
Quote:
<?php global $wpdb; $numposts = 32; $rand_posts = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_status = 'publish' ORDER BY RAND() LIMIT $numposts"); foreach($rand_posts as $post) : setup_postdata($post); ?> <?php endforeach; ?> |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Monger Cash
Industry Role:
Join Date: Jul 2010
Posts: 2,773
|
Here ya go.. the proper way to do it ><
For use as the main or only loop: PHP Code:
PHP Code:
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,319
|
Had someone that wanted to show recent photos from a category, (each photo represents a post *each image thumb taken from posts with attachments*.
he always had his galleries in 1 category, so he wanted a widget or a shortcode to show recent pics (galleries)
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Industry Role:
Join Date: Jul 2008
Location: In your back seat with duck tape
Posts: 4,568
|
Thanks i did get it to work
![]()
__________________
High Performance Vps $10 Linode Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Monger Cash
Industry Role:
Join Date: Jul 2010
Posts: 2,773
|
If you want to add a category clause to it.. you could add something like the following to the args array...
via category id: PHP Code:
PHP Code:
PHP Code:
|
![]() |
![]() ![]() ![]() ![]() ![]() |