diff --git a/partials/_article-cards.php b/partials/_article-cards.php index 55fa178b..6f53e990 100644 --- a/partials/_article-cards.php +++ b/partials/_article-cards.php @@ -159,6 +159,10 @@ $pag_args = array( $card_classes[] = '_seamless'; } + if ( ! $show_terms ) { + $card_classes[] = '_no-tax'; + } + if ( ! $args['footer'] ) { $card_classes[] = '_no-footer'; } diff --git a/partials/_latest-recommendations-compact.php b/partials/_latest-recommendations-compact.php index 13453757..0d45fb67 100644 --- a/partials/_latest-recommendations-compact.php +++ b/partials/_latest-recommendations-compact.php @@ -113,7 +113,8 @@ remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' ); $fandoms = $show_terms ? get_the_terms( $post, 'fcn_fandom' ) : []; $characters = $show_terms ? get_the_terms( $post, 'fcn_character' ) : []; $genres = $show_terms ? get_the_terms( $post, 'fcn_genre' ) : []; - $tags = get_option( 'fictioneer_show_tags_on_recommendation_cards' ) ? get_the_tags( $post ) : false; + $tags = ( $show_terms && get_option( 'fictioneer_show_tags_on_recommendation_cards' ) ) ? + get_the_tags( $post ) : false; $grid_or_vertical = $args['vertical'] ? '_vertical' : '_grid'; $card_classes = []; @@ -134,6 +135,10 @@ remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' ); $card_classes[] = '_seamless'; } + if ( ! $show_terms ) { + $card_classes[] = '_no-tax'; + } + // Truncate factor $truncate_factor = $args['vertical'] ? '_4-4' : '_cq-3-4'; diff --git a/partials/_latest-recommendations.php b/partials/_latest-recommendations.php index 3d8514e0..b5528ffb 100644 --- a/partials/_latest-recommendations.php +++ b/partials/_latest-recommendations.php @@ -36,7 +36,7 @@ defined( 'ABSPATH' ) OR exit; // Setup -$show_taxonomies = ! get_option( 'fictioneer_hide_taxonomies_on_recommendation_cards' ); +$show_terms = ! get_option( 'fictioneer_hide_taxonomies_on_recommendation_cards' ); // Prepare query $query_args = array ( @@ -108,10 +108,11 @@ remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' ); $post_id = $post->ID; $title = fictioneer_get_safe_title( $post_id, 'shortcode-latest-recommendations' ); $one_sentence = get_post_meta( $post_id, 'fictioneer_recommendation_one_sentence', true ); - $fandoms = get_the_terms( $post, 'fcn_fandom' ); - $characters = get_the_terms( $post, 'fcn_character' ); - $genres = get_the_terms( $post, 'fcn_genre' ); - $tags = get_option( 'fictioneer_show_tags_on_recommendation_cards' ) ? get_the_tags( $post ) : false; + $fandoms = $show_terms ? get_the_terms( $post, 'fcn_fandom' ) : []; + $characters = $show_terms ? get_the_terms( $post, 'fcn_character' ) : []; + $genres = $show_terms ? get_the_terms( $post, 'fcn_genre' ) : []; + $tags = ( $show_terms && get_option( 'fictioneer_show_tags_on_recommendation_cards' ) ) ? + get_the_tags( $post ) : false; $grid_or_vertical = $args['vertical'] ? '_vertical' : '_grid'; $card_classes = []; @@ -128,6 +129,10 @@ remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' ); $card_classes[] = '_seamless'; } + if ( ! $show_terms ) { + $card_classes[] = '_no-tax'; + } + // Truncate factor $truncate_factor = $args['vertical'] ? '_4-4' : '_3-3'; @@ -217,7 +222,7 @@ remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' ); ?> - +