Home Forums Basel support forum related post + mobile header problem Reply To: related post + mobile header problem

#10526

Artem Temos
Keymaster

Sorry, we understood you wrongly. If you want to change related posts number just add this code to the functions.php file in your child theme and replace 12 with your number

function basel_get_related_posts_args( $post_id ) {
    $taxs = wp_get_post_tags( $post_id );
    $args = array();
    if ( $taxs ) {
        $tax_ids = array();
        foreach( $taxs as $individual_tax ) $tax_ids[] = $individual_tax->term_id;
         
        $args = array(
            'tag__in'               => $tax_ids,
            'post__not_in'          => array( $post_id ),
            'showposts'             => 12,
            'ignore_sticky_posts'   => 1
        );  
        
    }

    return $args;
}

Regards