viz https://wordpress.org/support/topic/order-posts-by-date-ascending-in-a-particular-category :
I have had a go at solving thi smyself and it seems to work.
Here's what I did
1. Go to the template folder for the active wp templete
2. Copy index.php to a file called category-n.php (where n is the number of the category you wish to sort in). You can find this number by looking at the terms table in phpMyAdmin. In my case the category was 9 so I created a file called category-9.php
3. Edit category-n.php
4. just before the loop
place this line of code
5. Edit the cosmetic navigation page links from “Previous Posts” to “Further Posts” as follows. Change the line
To
`
6. Save the file and upload it to the template folder on your server.
Here's what I did
1. Go to the template folder for the active wp templete
2. Copy index.php to a file called category-n.php (where n is the number of the category you wish to sort in). You can find this number by looking at the terms table in phpMyAdmin. In my case the category was 9 so I created a file called category-9.php
3. Edit category-n.php
4. just before the loop
<?php while (have_posts()) : the_post(); ?>)place this line of code
<?php query_posts($query_string."&orderby=date&order=ASC"); ?>5. Edit the cosmetic navigation page links from “Previous Posts” to “Further Posts” as follows. Change the line
<div class="alignleft"><?php next_posts_link('« Previous Entries') ?></div>To
<div class="alignright"><?php next_posts_link('Further Entries »') ?></div>`
6. Save the file and upload it to the template folder on your server.
Žádné komentáře:
Okomentovat