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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 09-20-2009, 05:42 AM   #1
whiskey dick
Confirmed User
 
whiskey dick's Avatar
 
Join Date: Nov 2008
Posts: 106
WP/php question

I'm trying to list all the posts in a category alphabetically but the closest I've been able to get is
Code:
<?php wp_get_archives(type=alpha); ?>
(or something like that). That lists the posts in ALL categories alphabetically, is there a way to limit it to one category?
whiskey dick is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-20-2009, 06:09 AM   #2
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,359
http://codex.wordpress.org/Template_...ude_Categories
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-20-2009, 07:24 AM   #3
whiskey dick
Confirmed User
 
whiskey dick's Avatar
 
Join Date: Nov 2008
Posts: 106
Thanks for the reply fris. Its looking like I'll just be hardcoding these links since the category will only be updated once a week and this is proving to be way above my skill level.
whiskey dick is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-20-2009, 08:03 AM   #4
moeloubani
Confirmed User
 
moeloubani's Avatar
 
Industry Role:
Join Date: Dec 2007
Location: Ontario
Posts: 4,235
use <?php wp_list_categories('orderby=name'); ?> i think?

edit: or wait thats for categories (seemed so easy to cut and paste from the wp site that fris gave)

<?php wp_get_archives('orderby=title'); ?>

i usually just put stuff together till one of them works lol, good luck!

Last edited by moeloubani; 09-20-2009 at 08:05 AM..
moeloubani is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-20-2009, 08:17 AM   #5
whiskey dick
Confirmed User
 
whiskey dick's Avatar
 
Join Date: Nov 2008
Posts: 106
I'm actually trying to list the posts from a particular category in alphabetical order, not the category names.

I have a new site with a featured model category and on the page for the "Models" category (splackle.com/category/models/) I want an alphabetical list of all models I've added above the actual entries.

I just went ahead and put the link in by hand since I'll only be updating that category once a week and it shouldn't be a big deal to add a new one for each post.
whiskey dick is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-20-2009, 08:34 AM   #6
moeloubani
Confirmed User
 
moeloubani's Avatar
 
Industry Role:
Join Date: Dec 2007
Location: Ontario
Posts: 4,235
http://www.sramekdesign.com/wordpres...tain-category/

maybe this one?
moeloubani is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-20-2009, 11:07 AM   #7
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,359
Quote:
Originally Posted by whiskey dick View Post
I'm actually trying to list the posts from a particular category in alphabetical order, not the category names.

I have a new site with a featured model category and on the page for the "Models" category (splackle.com/category/models/) I want an alphabetical list of all models I've added above the actual entries.

I just went ahead and put the link in by hand since I'll only be updating that category once a week and it shouldn't be a big deal to add a new one for each post.
you want something like this then

Code:
<?php $my_query = new WP_Query('cat_name=models&showposts=50&orderby=title');
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID; ?>

<a href="<?php the_permalink();?>"><?php the_title();?></a>

<?php endwhile; ?>
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-20-2009, 08:22 PM   #8
whiskey dick
Confirmed User
 
whiskey dick's Avatar
 
Join Date: Nov 2008
Posts: 106
Woo thanks a ton guys, got it now.
whiskey dick is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-20-2009, 08:29 PM   #9
xxxjay
Tube groupie.
 
xxxjay's Avatar
 
Industry Role:
Join Date: Aug 2002
Location: LoScandalous, CA
Posts: 13,482
Quote:
Originally Posted by whiskey dick View Post
Woo thanks a ton guys, got it now.
what does the output look like?
xxxjay is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-20-2009, 08:40 PM   #10
whiskey dick
Confirmed User
 
whiskey dick's Avatar
 
Join Date: Nov 2008
Posts: 106
Quote:
Originally Posted by xxxjay View Post
what does the output look like?
Its the list at the top above the entries here: splackle.com/category/models/

I only have one post in the category so far but I added in a few dummy posts if you wanna check it out.
whiskey dick is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-20-2009, 09:03 PM   #11
xxxjay
Tube groupie.
 
xxxjay's Avatar
 
Industry Role:
Join Date: Aug 2002
Location: LoScandalous, CA
Posts: 13,482
i like it...you know thw caregories don't get much indexing usually, right?
xxxjay is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-20-2009, 09:13 PM   #12
whiskey dick
Confirmed User
 
whiskey dick's Avatar
 
Join Date: Nov 2008
Posts: 106
Yah its just there for anyone who ends up on that page through the link in the nav menu at the top or some other way to find what they're looking for easier.
whiskey dick is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-21-2009, 12:18 AM   #13
xxxjay
Tube groupie.
 
xxxjay's Avatar
 
Industry Role:
Join Date: Aug 2002
Location: LoScandalous, CA
Posts: 13,482
Quote:
Originally Posted by whiskey dick View Post
Yah its just there for anyone who ends up on that page through the link in the nav menu at the top or some other way to find what they're looking for easier.
very cool
xxxjay is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.