Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function custom_agenda_order( $orderby ) {
- global $wpdb;
- // Check if the query is for an archive
- if ( is_archive() && get_query_var("post_type") == "my_custom_post_type" ) {
- // Query was for archive, then set order
- return "$wpdb->posts.post_date ASC";
- }
- return $orderby;
- }
- add_filter( 'posts_orderby' , 'custom_agenda_order' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement