Add _no-tax modifier classes to shortcodes

This commit is contained in:
Tetrakern 2024-08-24 00:50:30 +02:00
parent ac9cae1ab4
commit a6ac055ee0
6 changed files with 33 additions and 7 deletions

View File

@ -159,6 +159,10 @@ $pag_args = array(
$card_classes[] = '_seamless';
}
if ( ! $show_terms ) {
$card_classes[] = '_no-tax';
}
if ( ! $args['footer'] ) {
$card_classes[] = '_no-footer';
}

View File

@ -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';

View File

@ -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' );
?></div>
</div>
<?php if ( $show_taxonomies ) : ?>
<?php if ( $show_terms ) : ?>
<div class="card__tag-list _small _scrolling cell-tax">
<div class="card__h-scroll <?php echo $args['terms'] === 'pills' ? '_pills' : ''; ?>">
<?php

View File

@ -171,6 +171,10 @@ remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
$card_classes[] = '_seamless';
}
if ( ! $show_terms || ! ( $story['has_taxonomies'] || $tags ) ) {
$card_classes[] = '_no-tax';
}
if ( ! $args['footer'] ) {
$card_classes[] = '_no-footer';
}

View File

@ -161,6 +161,10 @@ remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
$card_classes[] = '_seamless';
}
if ( ! $show_terms || ! ( $story['has_taxonomies'] || $tags ) ) {
$classes[] = '_no-tax';
}
if ( ! $args['footer'] ) {
$card_classes[] = '_no-footer';
}

View File

@ -181,6 +181,10 @@ remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
$card_classes[] = '_seamless';
}
if ( ! $show_terms || ! ( $story['has_taxonomies'] || $tags ) ) {
$card_classes[] = '_no-tax';
}
if ( ! $args['words'] ) {
$card_classes[] = '_no-chapter-words';
}