How to remove or disable Related Posts function
-
Hello all.
How do I completely remove/disable the Related Posts function from the Hueman theme? I tried to do this via my child theme stylesheet, like so:
.related-posts { display: none; }
This removed the actual links/thumbnails to related posts, but the related posts heading (“You May Also Like…”) still appears. You can see the problem here.
I’m guessing that I need to modify some code in the functions.php file, but I’m clueless about PHP. How do I remove, or disable, or comment-out, this function?
/* Related posts /* ------------------------------------ */ if ( ! function_exists( 'alx_related_posts' ) ) { function alx_related_posts() { wp_reset_postdata(); global $post; // Define shared post arguments $args = array( 'no_found_rows' => true, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, 'ignore_sticky_posts' => 1, 'orderby' => 'rand', 'post__not_in' => array($post->ID), 'posts_per_page' => 3 ); // Related by categories if ( ot_get_option('related-posts') == 'categories' ) { $cats = get_post_meta($post->ID, 'related-cat', true); if ( !$cats ) { $cats = wp_get_post_categories($post->ID, array('fields'=>'ids')); $args['category__in'] = $cats; } else { $args['cat'] = $cats; } } // Related by tags if ( ot_get_option('related-posts') == 'tags' ) { $tags = get_post_meta($post->ID, 'related-tag', true); if ( !$tags ) { $tags = wp_get_post_tags($post->ID, array('fields'=>'ids')); $args['tag__in'] = $tags; } else { $args['tag_slug__in'] = explode(',', $tags); } if ( !$tags ) { $break = true; } } $query = !isset($break)?new WP_Query($args):new WP_Query; return $query; } }
Thank you in advance!
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘How to remove or disable Related Posts function’ is closed to new replies.