show resources title, category or tag in view
This commit is contained in:
parent
5c05c0f1e3
commit
9398258fb6
|
@ -29,7 +29,8 @@ endif;
|
|||
<main>
|
||||
<?php
|
||||
// https://codex.wordpress.org/Conditional_Tags
|
||||
if ( is_post_type_archive ( 'archive_resource' ) ) :
|
||||
// if ( is_post_type_archive ( 'archive_resource' ) ) :
|
||||
if ( is_post_type_archive ( 'archive_resource' ) || is_tax( 'archive_resource_category' ) || is_tax( 'archive_resource_tag' ) ) :
|
||||
//https://developer.wordpress.org/reference/functions/get_template_part/#comment-4130
|
||||
//get_template_part( 'template-parts/section', 'resources', array( 'post_per_page' => '10' ) );
|
||||
get_template_part( 'template-parts/archive', 'resources');
|
||||
|
|
|
@ -27,8 +27,9 @@ get_header(); ?>
|
|||
<?php echo get_search_query( ); ?>
|
||||
</h2>
|
||||
</header>
|
||||
|
||||
|
||||
<aside class="hero hero-announcement resources">
|
||||
<?php dynamic_sidebar( 'announcement-resources-middle-widgets' ); ?>
|
||||
</aside>
|
||||
<main class="">
|
||||
<?php if ( have_posts() ) : ?>
|
||||
<?php while ( have_posts() ) : the_post(); ?>
|
||||
|
|
|
@ -21,13 +21,18 @@
|
|||
|
||||
<section class="archive-posts resources">
|
||||
<header>
|
||||
<h2>
|
||||
<h2>Resources <?php //post_type_archive_title(); ?></h2>
|
||||
<?php
|
||||
if ( is_post_type_archive() ):
|
||||
post_type_archive_title();
|
||||
if ( is_tax( 'archive_resource_category' ) ):
|
||||
echo '<h4 class="">';
|
||||
single_cat_title( '<span class="h6">category:</span> ' );
|
||||
echo '</h4>';
|
||||
elseif ( is_tax( 'archive_resource_tag' ) ):
|
||||
echo '<h4 class="">';
|
||||
single_term_title( '<span class="h5">#</span>' );
|
||||
echo '</h4>';
|
||||
endif;
|
||||
?>
|
||||
</h2>
|
||||
</header>
|
||||
<aside class="hero hero-announcement resources">
|
||||
<?php dynamic_sidebar( 'announcement-resources-middle-widgets' ); ?>
|
||||
|
|
Loading…
Reference in New Issue