Hey, I'm trying to create a custom page that will display a single categories post alphabetically, not all categories. I found this.. http://codex.wordpress.org/Alphabetizing_Posts I created the custom file with the category id as the file name added the extra code before the loop. I then create a page from the admin panel and use the file as my page template, when I try to view it nothing shows. Not really sure how wordpress knows which category to select. Any help would be great! Thanks
Was it coded as a template file? <?php /* Template Name: TEMPLATE NAME */ ?> TEMPLATE CODE Code (markup): Creating Your Own Page Templates
Hey, Yeah, what I don't understand is how to alphabetize a single category, wordpress does this automatically with category pages but I want to only do this to 1 category. Which is why I am creating a custom page. Do you know how to "call" a specific category to show?
<?php $getposts = get_posts('category=ID&order=ASC&orderby=title&numberposts=-1'); foreach($getposts as $post) : ?> <h2><a href="<?php the_permalink(); ?>" id="post-<?php the_ID(); ?>"><?php the_title(); ?></a><h2> <?php the_excerpt(); ?> <?php endforeach; ?> Code (markup): Just replace ID with with category number. Hope it works, I didn't bother testing it.