Hi,
Unfortunately that sort order doesn’t exist on block, but you can add it like this:
*in td_data_source.php: http://screencast.com/t/DGxvKZhvTu
case 'date_ascending':
$wp_query_args['orderby'] = 'date';
$wp_query_args['order'] = 'ASC';
break;
*in td_config.php: http://screencast.com/t/WTt1CgNa4wX
'Date Ascending' => 'date_ascending'
Result: http://screencast.com/t/r4gmhOhp – http://screencast.com/t/NZoEWdqrBBl
Thanks!
How would I order by asc in a widget?
I added as you instructed above.
AND
I added the following to my functions file and now the posts order the way I want them to on a page but they don’t order properly in a widget on a sidebar.
add_action(‘wp_head’, ‘custom_change_posts_order’);
function custom_change_posts_order() {
global $query_string;
if (is_category(array(6777))) {
$posts = query_posts( $query_string . ‘&orderby=date&order=asc’ );
}
};
Hi
The code that you provided affect only the posts displayed by the loop on category page: http://screencast.com/t/sifOdJro The posts from sidebar are displayed by a different query, depending by the widget used. If you use one of the theme’s blocks then the query is made in td_data_source.php and you can use theirs filters to sort your posts: http://screencast.com/t/gbllh8R6iu If the widget it’s from WordPress then the query is made in WordPress core.
Thanks!
I got it to work. Thank you.
Of course, it was human error.
The old code I had said “case ‘ascending’:” when it should have been “case ‘date_ascending’:.”
I appreciate your help.
Teri
Is the code from Alin still working? As soon as I add the one to td_config, my whole WordPress goes down.
Hi
The code still works, just make sure you add it like here: http://screencast.com/t/kE7zYTSR3 – http://screencast.com/t/5xHv0jgPjY
Thanks!
Thanks for the fast reply!
It works perfectly now. This way I can have a beautiful event list on my homepage.
(I love the theme BTW)