Resources presented as 5 columns. other post archives 3 column

This commit is contained in:
jorge 2022-03-30 21:14:48 +02:00
parent d009ca412d
commit a330d65f22
5 changed files with 62 additions and 63 deletions

View File

@ -32,7 +32,7 @@ endif;
if ( is_post_type_archive ( 'archive_resource' ) ) : if ( is_post_type_archive ( 'archive_resource' ) ) :
//https://developer.wordpress.org/reference/functions/get_template_part/#comment-4130 //https://developer.wordpress.org/reference/functions/get_template_part/#comment-4130
get_template_part( 'template-parts/section', 'resources', array( 'custom_post_type' => 'archive_resource', 'post_per_page' => '10' ) ); get_template_part( 'template-parts/section', 'resources', array( 'post_per_page' => '10' ) );
elseif ( is_category( 'resources' ) ): elseif ( is_category( 'resources' ) ):
get_template_part( 'template-parts/section', 'categoryposts', array( 'category_name' => 'resources', 'post_per_page' => '10' ) ); get_template_part( 'template-parts/section', 'categoryposts', array( 'category_name' => 'resources', 'post_per_page' => '10' ) );

File diff suppressed because one or more lines are too long

View File

@ -74,7 +74,7 @@
// category view and news // category view and news
//-------------- //--------------
.category-posts { .category-posts,.archive-posts {
@include xy-grid; @include xy-grid;
header,main,aside { header,main,aside {
@include breakpoint(small){ @include breakpoint(small){
@ -129,7 +129,6 @@
line-height: 0.7; line-height: 0.7;
font-size: $global-font-size*1.5; font-size: $global-font-size*1.5;
} }
} }
} }
aside { aside {

View File

@ -74,7 +74,7 @@
// category view and news // category view and news
//-------------- //--------------
.category-posts { .category-posts,.archive-posts {
@include xy-grid; @include xy-grid;
header,main,aside { header,main,aside {
@include breakpoint(small){ @include breakpoint(small){
@ -129,7 +129,6 @@
line-height: 0.7; line-height: 0.7;
font-size: $global-font-size*1.5; font-size: $global-font-size*1.5;
} }
} }
} }
aside { aside {

View File

@ -13,18 +13,19 @@
//https://developer.wordpress.org/reference/functions/get_template_part/#comment-4130 //https://developer.wordpress.org/reference/functions/get_template_part/#comment-4130
// var_dump( $args ); //will display everythin imported from // var_dump( $args ); //will display everythin imported from
// get_template_part( 'template-parts/section', 'category', array('category_name' => 'news', 'post_per_page' => '3' ) ); // get_template_part( 'template-parts/section', 'category', array('category_name' => 'news', 'post_per_page' => '3' ) );
$thiscustomposttype = $args['custom_post_type']; $thiscustomposttype = get_post_type( get_the_ID() );
$howmanyposts = $args['post_per_page']; $howmanyposts = $args['post_per_page'];
?> ?>
<section class="archive-resources"> <section class="archive-posts resources">
<header> <header>
<h2> <h2>
<?php <?php
if ( is_post_type_archive($thiscustomposttype) ): // if ( is_post_type_archive() ):
//post_type_archive_title(); post_type_archive_title();
else: // else:
echo $thiscustomposttype; // echo $thiscustomposttype;
endif;?> // endif;
?>
</h2> </h2>
</header> </header>
<main class=""> <main class="">