wordpress php
- Started
- Last post
- 2 Responses
- JamesBoynton
hey guy looking for some php on wordpress help. I have a page of posts from a specific category, i set up a template for the category and added this line of php which works fine and pulls through the category 1 as expected.
------------
<?php if (have_posts()) : ?>
<?php query_posts('cat=1'); ?>
<?php while (have_posts()) : the_post(); ?>
------------The problem is i need the posts to be oldes to newest, so to do that i add this code
-------------
<?php query_posts($query_string . '&order=ASC') ?>
-------------But when i add that to the code it doesnt work, i guess its because i have 2 query_posts? I know very little about php, is there anyway i can make <?php query_posts('cat=1'); ?> and <?php query_posts($query_string . '&order=ASC') ?>
into one line?any help would be great.
james
- VanDerFull0
Wouldn't this work:
<?php if (have_posts()) : ?>
<?php query_posts('cat=1&orderby=date&order=ASC''); ?>
<?php while (have_posts()) : the_post(); ?>Check usage here
- JamesBoynton0
ace, will have a check now.. i had no idea how to put it all together
cheers!