I know there is a ‘how to’ explanation in this forum for post navigation order bij Post Title in alphabetical order. I tried to adjust that for my situation, but it doesn’t work and I don’t know how to make it work (I’m no coder). So please, is there anybody who wants to help me and correct it for me? This is what I made of the code timmse provided in answer to the post before.
function filter_next_post_sort($sort) {
global $post;
if (get_post_type($post) == ‘Project’) {
$sort = “ORDER BY p.post_date ASC LIMIT 1”;
return $sort;
}
}
function filter_next_post_where($where) {
global $post, $wpdb;
if (get_post_type($post) == ‘Project’) {
return $wpdb->prepare(“WHERE p.post_date > ‘%s’ AND p.post_type = '”. get_post_type($post).“’ AND p.post_status = ‘publish’”,$post->post_date);
}
}
function filter_previous_post_sort($sort) {
global $post;
if (get_post_type($post) == ‘Project’) {
$sort = “ORDER BY p.post_date DESC LIMIT 1”;
return $sort;
}
}
function filter_previous_post_where($where) {
global $post, $wpdb;
if (get_post_type($post) == ‘Project’) {
return $wpdb->prepare(“WHERE p.post_date < ‘%s’ AND p.post_type = '”. get_post_type($post).“’ AND p.post_status = ‘publish’”,$post->post_date);
}
}