fictioneer/taxonomy-fcn_content_warning.php

107 lines
3.0 KiB
PHP
Raw Normal View History

2023-01-21 01:31:34 +01:00
<?php
/**
* Content Warning custom taxonomy archives
*
* @package WordPress
* @subpackage Fictioneer
* @since 4.6.0
2023-01-21 01:31:34 +01:00
* @see partials/_archive-loop.php
*/
// Header
get_header();
?>
2023-01-21 01:31:34 +01:00
<main id="main" class="main archive content-warning-archive">
<?php do_action( 'fictioneer_main', 'content-warning-archive' ); ?>
2023-01-21 01:31:34 +01:00
<div class="main__wrapper">
2023-01-21 01:31:34 +01:00
<?php do_action( 'fictioneer_main_wrapper' ); ?>
2024-08-12 02:42:45 +02:00
<article class="archive__article">
2023-01-21 01:31:34 +01:00
<header class="archive__header">
<div class="tax-cloud">
<?php
// Setup
$current_id = get_queried_object()->term_id;
$current_count = get_queried_object()->count;
$current_description = get_queried_object()->description;
$parent = get_term_by( 'id', get_queried_object()->parent, get_query_var( 'taxonomy' ) );
?>
<div class="tax-cloud__header">
<h1 class="tax-cloud__current">
<?php
printf(
_n(
'<span class="tax-cloud__number">%1$s</span> Result with the <em>"%2$s"</em> warning %3$s',
'<span class="tax-cloud__number">%1$s</span> Results with the <em>"%2$s"</em> warning %3$s',
2023-01-21 01:31:34 +01:00
$current_count,
'fictioneer'
),
$current_count,
single_tag_title( '', false ),
$parent ? sprintf( _x( '(%s)', 'Taxonomy page parent suffix.', 'fictioneer' ), $parent->name ) : ''
2023-01-21 01:31:34 +01:00
)
?>
</h1>
<?php if ( ! empty( $current_description ) ) : ?>
<p class="tax-cloud__tax-description">
<?php echo
sprintf(
__( '<strong>Definition:</strong> %s', 'fictioneer' ),
$current_description
)
?>
</p>
<?php endif; ?>
</div>
<?php
wp_tag_cloud(
array(
2024-11-27 21:39:53 +01:00
'fictioneer_query_name' => 'tag_cloud',
2023-01-21 01:31:34 +01:00
'smallest' => .625,
'largest' => 1.25,
'unit' => 'rem',
'number' => 0,
'taxonomy' => ['fcn_content_warning'],
'exclude' => $current_id,
'show_count' => true,
'pad_counts' => true
)
);
?>
</div>
</header>
<?php get_template_part( 'partials/_archive-loop', null, array( 'taxonomy' => 'fcn_content_warning' ) ); ?>
2023-01-21 01:31:34 +01:00
</article>
2023-01-21 01:31:34 +01:00
</div>
2024-09-07 16:57:34 +02:00
<?php do_action( 'fictioneer_main_end', 'content-warning-archive' ); ?>
2023-01-21 01:31:34 +01:00
</main>
<?php
// Footer arguments
$footer_args = array(
'post_type' => null,
'post_id' => null,
'template' => 'taxonomy-fcn_content_warning.php',
'breadcrumbs' => array(
[fcntr( 'frontpage' ), get_home_url()],
[sprintf( __( 'Results for Content Warning "%s"', 'fictioneer' ), single_tag_title( '', false ) ), null]
)
);
// Get footer with breadcrumbs
get_footer( null, $footer_args );
?>