Last active
February 5, 2016 10:19
-
-
Save keesiemeijer/abfc5af9662bc781e725 to your computer and use it in GitHub Desktop.
Add post terms to related posts results
This file contains 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 characters
<?php | |
add_filter( 'related_posts_by_taxonomy_posts_clauses', 'rpbt_post_where', 10, 4 ); | |
function rpbt_post_where( $pieces, $post_id, $taxonomies, $args ) { | |
global $wpdb; | |
$pieces['select_sql'] .= " , GROUP_CONCAT( DISTINCT tt.term_id SEPARATOR ',' ) as related_terms "; | |
return $pieces; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For mysql only