Created
November 3, 2015 10:25
-
-
Save resarahman/a7cae9a3d4ba6bfc637d to your computer and use it in GitHub Desktop.
Revisions
-
resarahman created this gist
Nov 3, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ <?php function custom_next_prev_post_links( $join, $in_same_term, $excluded_terms, $taxonomy, $post ){ global $wpdb; $join .= " INNER JOIN $wpdb->postmeta AS m ON p.ID = m.post_id AND m.meta_key = 'your_meta_key_name'"; return $join; } add_filter('get_next_post_join', 'custom_next_prev_post_links', 10, 5); add_filter('get_previous_post_join', 'custom_next_prev_post_links', 10, 5);