Hot answers tagged

1

Here's a full working code for whomever may need it: $tags_id = wp_get_post_tags($post->ID); $first_tag = $tags_id[0]->term_id; $categories_id = wp_get_post_categories($post->ID); $first_category = $categories_id[0]; $by_tag = new WP_Query( array( 'post__not_in' => array($post->ID), 'tag__in' => $first_tag ) ); if ( $by_tag->...


1

It's a neat idea! The way I would tackle the problem is to create an associative array of post IDs mapped to their individual weights. Since weights are subjective - that is, the represent the value of other posts' relationships with the post currently being displayed - it doesn't make much sense to store these weights in the database each time you process ...



Only top voted, non community-wiki answers of a minimum length are eligible