display properly the resources and deleted uneeded templates

This commit is contained in:
jorge 2022-04-11 04:27:59 +02:00
parent 99f60a7ce4
commit da6976e227
6 changed files with 56 additions and 104 deletions

View File

@ -18,7 +18,7 @@
get_header(); ?> get_header(); ?>
<?php <?php
if ( is_post_type_archive ( 'archive_resource' ) ) : if ( is_post_type_archive ( 'archive_resource' ) || is_tax( 'archive_resource_category' ) || is_tax( 'archive_resource_tag' ) ) :
get_template_part( 'template-parts/announcement', 'resources' ); get_template_part( 'template-parts/announcement', 'resources' );
else: else:
get_template_part( 'template-parts/announcement', '' ); get_template_part( 'template-parts/announcement', '' );
@ -41,27 +41,57 @@ endif;
else : else :
?> ?>
<?php if ( have_posts() ) : <section class="search-results-content">
// Start the Loop <header>
while ( have_posts() ) : the_post(); <h4>search results for:</h4>
get_template_part( 'template-parts/content', get_post_format() ); <h2>
endwhile; <span class="search-query-terms">
else : <?php echo get_search_query( ); ?>
get_template_part( 'template-parts/content', 'none' ); </h2>
endif; // End have_posts() check. </header>
?>
<?php
// Display navigation to next/previous pages when applicable <main class="">
if ( function_exists( 'foundationpress_pagination' ) ) : <?php if ( have_posts() ) : ?>
foundationpress_pagination(); <?php while ( have_posts() ) : the_post(); ?>
elseif ( is_paged() ) : <article class="">
?> <?php if ( has_post_thumbnail() ) :?>
<nav id="post-nav"> <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
<div class="post-previous"><?php next_posts_link( __( '&larr; Older posts', 'foundationpress' ) ); ?></div> <figure style="background-image: url(<?php echo get_the_post_thumbnail_url();?>);">
<div class="post-next"><?php previous_posts_link( __( 'Newer posts &rarr;', 'foundationpress' ) ); ?></div> </figure>
</nav> </a>
<?php else :?>
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
<figure style="background-image: url(<?php echo catch_post_first_image();?>);">
</figure>
</a>
<?php endif;?> <?php endif;?>
<h5 class="date">
<?php //the_date('d.m.Y');?>
</h5>
<h3 class="entry-title">
<a href="<?php the_permalink(); ?>" rel="bookmark">
<?php the_title(); ?>
</a>
</h3>
<section class="excerpt post-excerpt">
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
<?php the_excerpt() ?>
</a>
</section>
</article>
<?php endwhile;//end of the loop ?>
</main>
<?php //pagination here ?>
<aside>
<nav>
<!--a href="" class="button hollow">see more news</a-->
</nav>
</aside>
<?php else : //if no post in query ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>
<?php <?php
endif;//end if is archive_resource endif;//end if is archive_resource

View File

@ -1,79 +0,0 @@
<?php
/**
* The template for displaying archive pages
*
* Used to display archive-type pages if nothing more specific matches a query.
* For example, puts together date-based pages if no date.php file exists.
*
* If you'd like to further customize these archive views, you may create a
* new template file for each one. For example, tag.php (Tag archives),
* category.php (Category archives), author.php (Author archives), etc.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package arcHIVE-theme
* @since arcHIVE-theme 1.0.0
*/
get_header(); ?>
<article>
<main>
<?php// get_template_part( 'template-parts/section', 'categoryposts' ); ?>
<section class="category-posts">
<header>
<h2><?php single_term_title( );?></h2>
</header>
<main class="">
<?php $thiscategoryid = get_queried_object_id();?>
<?php $the_query = new WP_Query( array( 'cat' => $thiscategoryid, 'posts_per_page' => 6 ) ); ?>
<?php if ( $the_query->have_posts() ) : ?>
<?php //the loop ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<?php //content here ?>
<article class="">
<?php if ( has_post_thumbnail() ) :?>
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
<figure style="background-image: url(<?php echo get_the_post_thumbnail_url();?>);">
</figure>
</a>
<?php else :?>
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
<figure style="background-image: url(<?php echo catch_post_first_image();?>);">
</figure>
</a>
<?php endif;?>
<h5 class="date">
<?php //the_date('d.m.Y');?>
</h5>
<h3 class="entry-title">
<a href="<?php the_permalink(); ?>" rel="bookmark">
<?php the_title(); ?>
</a>
</h3>
<section class="excerpt post-excerpt">
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
<?php the_excerpt() ?>
</a>
</section>
</article>
<?php endwhile; ?>
<?php // end of the loop ?>
<?php //pagination here ?>
<?php wp_reset_postdata(); ?>
<?php else : ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>
</main>
<aside>
<nav>
<!--a href="" class="button hollow">see more content</a-->
</nav>
</aside>
</section>
</main>
</article>
<?php get_footer();

File diff suppressed because one or more lines are too long

View File

@ -151,7 +151,7 @@ main {
} }
} }
&.resources { &.resources,&.search-results-content,&.tax-archive_resource_category,&.tax-archive_resource_tag {
@include xy-grid; @include xy-grid;
header,main,aside { header,main,aside {
} }

View File

@ -71,4 +71,5 @@ get_header(); ?>
<?php endif; ?> <?php endif; ?>
</main> </main>
</article>
<?php get_footer(); <?php get_footer();

View File

@ -151,7 +151,7 @@ main {
} }
} }
&.resources { &.resources,&.search-results-content,&.tax-archive_resource_category,&.tax-archive_resource_tag {
@include xy-grid; @include xy-grid;
header,main,aside { header,main,aside {
} }