display properly the resources and deleted uneeded templates
This commit is contained in:
parent
99f60a7ce4
commit
da6976e227
70
archive.php
70
archive.php
|
@ -18,7 +18,7 @@
|
|||
get_header(); ?>
|
||||
|
||||
<?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' );
|
||||
else:
|
||||
get_template_part( 'template-parts/announcement', '' );
|
||||
|
@ -41,28 +41,58 @@ endif;
|
|||
else :
|
||||
?>
|
||||
|
||||
<?php if ( have_posts() ) :
|
||||
// Start the Loop
|
||||
while ( have_posts() ) : the_post();
|
||||
get_template_part( 'template-parts/content', get_post_format() );
|
||||
endwhile;
|
||||
else :
|
||||
get_template_part( 'template-parts/content', 'none' );
|
||||
endif; // End have_posts() check.
|
||||
?>
|
||||
<section class="search-results-content">
|
||||
<header>
|
||||
<h4>search results for:</h4>
|
||||
<h2>
|
||||
<span class="search-query-terms">
|
||||
<?php echo get_search_query( ); ?>
|
||||
</h2>
|
||||
</header>
|
||||
|
||||
<?php
|
||||
// Display navigation to next/previous pages when applicable
|
||||
if ( function_exists( 'foundationpress_pagination' ) ) :
|
||||
foundationpress_pagination();
|
||||
elseif ( is_paged() ) :
|
||||
?>
|
||||
<nav id="post-nav">
|
||||
<div class="post-previous"><?php next_posts_link( __( '← Older posts', 'foundationpress' ) ); ?></div>
|
||||
<div class="post-next"><?php previous_posts_link( __( 'Newer posts →', 'foundationpress' ) ); ?></div>
|
||||
</nav>
|
||||
|
||||
<main class="">
|
||||
<?php if ( have_posts() ) : ?>
|
||||
<?php while ( have_posts() ) : the_post(); ?>
|
||||
<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;//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
|
||||
endif;//end if is archive_resource
|
||||
?>
|
||||
|
|
|
@ -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
|
@ -72,7 +72,7 @@ main {
|
|||
// category view, news, search results
|
||||
//--------------
|
||||
|
||||
.category-posts,.archive-posts,.search-results-content {
|
||||
.category-posts,.archive-posts,.search-results-content{
|
||||
@include xy-grid;
|
||||
header {
|
||||
@include breakpoint(small){
|
||||
|
@ -151,7 +151,7 @@ main {
|
|||
|
||||
}
|
||||
}
|
||||
&.resources {
|
||||
&.resources,&.search-results-content,&.tax-archive_resource_category,&.tax-archive_resource_tag {
|
||||
@include xy-grid;
|
||||
header,main,aside {
|
||||
}
|
||||
|
|
|
@ -71,4 +71,5 @@ get_header(); ?>
|
|||
<?php endif; ?>
|
||||
|
||||
</main>
|
||||
</article>
|
||||
<?php get_footer();
|
||||
|
|
|
@ -72,7 +72,7 @@ main {
|
|||
// category view, news, search results
|
||||
//--------------
|
||||
|
||||
.category-posts,.archive-posts,.search-results-content {
|
||||
.category-posts,.archive-posts,.search-results-content{
|
||||
@include xy-grid;
|
||||
header {
|
||||
@include breakpoint(small){
|
||||
|
@ -151,7 +151,7 @@ main {
|
|||
|
||||
}
|
||||
}
|
||||
&.resources {
|
||||
&.resources,&.search-results-content,&.tax-archive_resource_category,&.tax-archive_resource_tag {
|
||||
@include xy-grid;
|
||||
header,main,aside {
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue