GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   WP/php question (https://gfy.com/showthread.php?t=928803)

whiskey dick 09-20-2009 05:42 AM

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?

fris 09-20-2009 06:09 AM

http://codex.wordpress.org/Template_...ude_Categories

whiskey dick 09-20-2009 07:24 AM

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.

moeloubani 09-20-2009 08:03 AM

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!

whiskey dick 09-20-2009 08:17 AM

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.

moeloubani 09-20-2009 08:34 AM

http://www.sramekdesign.com/wordpres...tain-category/

maybe this one?

fris 09-20-2009 11:07 AM

Quote:

Originally Posted by whiskey dick (Post 16340407)
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; ?>


whiskey dick 09-20-2009 08:22 PM

Woo thanks a ton guys, got it now.

xxxjay 09-20-2009 08:29 PM

Quote:

Originally Posted by whiskey dick (Post 16342151)
Woo thanks a ton guys, got it now.

what does the output look like?

whiskey dick 09-20-2009 08:40 PM

Quote:

Originally Posted by xxxjay (Post 16342166)
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.

xxxjay 09-20-2009 09:03 PM

i like it...you know thw caregories don't get much indexing usually, right?

whiskey dick 09-20-2009 09:13 PM

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.

xxxjay 09-21-2009 12:18 AM

Quote:

Originally Posted by whiskey dick (Post 16342240)
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


All times are GMT -7. The time now is 08:49 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123