Compare commits

..

3 Commits

6 changed files with 163 additions and 39 deletions

3
.gitignore vendored
View File

@ -1,5 +1,4 @@
_off/ _*
_codenotes.txt
originalPHPfiles/ originalPHPfiles/
FoundationPress/ FoundationPress/
.DS_Store .DS_Store

View File

@ -17,38 +17,64 @@
get_header(); ?> get_header(); ?>
<div class="main-container"> <?php
<div class="main-grid"> if ( is_post_type_archive ( 'archive_resource' ) ) :
<main class="main-content"> get_template_part( 'template-parts/announcement', 'resources' );
<?php if ( have_posts() ) : ?> else:
get_template_part( 'template-parts/announcement', '' );
<?php /* Start the Loop */ ?> endif;
<?php while ( have_posts() ) : the_post(); ?> ?>
<?php get_template_part( 'template-parts/content', get_post_format() ); ?>
<?php endwhile; ?> <article>
<main>
<?php else : ?> <?php
<?php get_template_part( 'template-parts/content', 'none' ); ?> // https://codex.wordpress.org/Conditional_Tags
if ( is_post_type_archive ( 'archive_resource' ) ) :
<?php endif; // End have_posts() check. ?>
//https://developer.wordpress.org/reference/functions/get_template_part/#comment-4130
<?php /* Display navigation to next/previous pages when applicable */ ?> get_template_part( 'template-parts/section', 'resources', array( 'custom_post_type' => 'archive_resource', 'post_per_page' => '10' ) );
<?php
if ( function_exists( 'foundationpress_pagination' ) ) : elseif ( is_category( 'resources' ) ):
foundationpress_pagination(); get_template_part( 'template-parts/section', 'categoryposts', array( 'category_name' => 'resources', 'post_per_page' => '10' ) );
elseif ( is_paged() ) : elseif ( is_category( '' ) ):
?> get_template_part( 'template-parts/section', 'categoryposts', array('post_per_page' => '6' ) );
<nav id="post-nav">
<div class="post-previous"><?php next_posts_link( __( '&larr; Older posts', 'foundationpress' ) ); ?></div> else :
<div class="post-next"><?php previous_posts_link( __( 'Newer posts &rarr;', 'foundationpress' ) ); ?></div> ?>
</nav>
<?php endif; ?> <?php if ( have_posts() ) :
// Start the Loop
</main> while ( have_posts() ) : the_post();
<?php //get_sidebar(); ?> get_template_part( 'template-parts/content', get_post_format() );
endwhile;
</div> else :
</div> get_template_part( 'template-parts/content', 'none' );
endif; // End have_posts() check.
?>
<?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( __( '&larr; Older posts', 'foundationpress' ) ); ?></div>
<div class="post-next"><?php previous_posts_link( __( 'Newer posts &rarr;', 'foundationpress' ) ); ?></div>
</nav>
<?php endif; ?>
<?php
endif;//end if is archive_resource
?>
</main>
</article>
<?php get_footer(); <?php get_footer();

View File

@ -19,7 +19,7 @@ get_header(); ?>
<article> <article>
<main> <main>
<?php// get_template_part( 'template-parts/section', 'news' ); ?> <?php// get_template_part( 'template-parts/section', 'categoryposts' ); ?>
<section class="category-posts"> <section class="category-posts">
<header> <header>
<h2><?php single_term_title( );?></h2> <h2><?php single_term_title( );?></h2>
@ -64,7 +64,7 @@ get_header(); ?>
<?php else : ?> <?php else : ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p> <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?> <?php endif; ?>
</main> </main>
<aside> <aside>
<nav> <nav>

View File

@ -12,7 +12,7 @@ if ( ! function_exists( 'foundationpress_sidebar_widgets' ) ) :
array( array(
'id' => 'home-announcement-widgets', 'id' => 'home-announcement-widgets',
'name' => __( 'Home Announcement widgets', 'foundationpress' ), 'name' => __( 'Home Announcement widgets', 'foundationpress' ),
'description' => __( 'Drag widgets to this Home page container that will show at the top.', 'foundationpress' ), 'description' => __( 'Drag widgets to this Home page container that will show at the top of the home page.', 'foundationpress' ),
'before_sidebar'=> '<main class="slides">', 'before_sidebar'=> '<main class="slides">',
'after_sidebar' => '</main>', 'after_sidebar' => '</main>',
'before_widget' => '<section id="%1$s" class="widget slide home-announcement %2$s">', 'before_widget' => '<section id="%1$s" class="widget slide home-announcement %2$s">',
@ -25,7 +25,7 @@ if ( ! function_exists( 'foundationpress_sidebar_widgets' ) ) :
array( array(
'id' => 'home-announcement-middle-widgets', 'id' => 'home-announcement-middle-widgets',
'name' => __( 'Home Announcement Middle widgets', 'foundationpress' ), 'name' => __( 'Home Announcement Middle widgets', 'foundationpress' ),
'description' => __( 'Drag widgets to this Home page container that will show in the middle.', 'foundationpress' ), 'description' => __( 'Drag widgets to this Home page container that will show in the middle of the home page.', 'foundationpress' ),
'before_sidebar'=> '<main class="slides">', 'before_sidebar'=> '<main class="slides">',
'after_sidebar' => '</main>', 'after_sidebar' => '</main>',
'before_widget' => '<section id="%1$s" class="widget slide home-middle-announcement %2$s">', 'before_widget' => '<section id="%1$s" class="widget slide home-middle-announcement %2$s">',
@ -38,7 +38,7 @@ if ( ! function_exists( 'foundationpress_sidebar_widgets' ) ) :
array( array(
'id' => 'home-announcement-bottom-widgets', 'id' => 'home-announcement-bottom-widgets',
'name' => __( 'Home Announcement Bottom widgets', 'foundationpress' ), 'name' => __( 'Home Announcement Bottom widgets', 'foundationpress' ),
'description' => __( 'Drag widgets to this Home page container that will show at the bottom.', 'foundationpress' ), 'description' => __( 'Drag widgets to this Home page container that will show at the bottom of the home page.', 'foundationpress' ),
'before_sidebar'=> '<main class="slides">', 'before_sidebar'=> '<main class="slides">',
'after_sidebar' => '</main>', 'after_sidebar' => '</main>',
'before_widget' => '<section id="%1$s" class="widget slide home-bottom-announcement %2$s">', 'before_widget' => '<section id="%1$s" class="widget slide home-bottom-announcement %2$s">',
@ -58,6 +58,17 @@ if ( ! function_exists( 'foundationpress_sidebar_widgets' ) ) :
'after_title' => '</h6>', 'after_title' => '</h6>',
) )
); );
register_sidebar(
array(
'id' => 'announcement-resources-widgets',
'name' => __( 'Announcement Resources widgets', 'foundationpress' ),
'description' => __( 'Drag widgets to this announcement container to be displayed in Resources.', 'foundationpress' ),
'before_widget' => '<section id="%1$s" class="widget slide %2$s">',
'after_widget' => '</section>',
'before_title' => '<h6>',
'after_title' => '</h6>',
)
);
register_sidebar( register_sidebar(
array( array(

View File

@ -0,0 +1,16 @@
<?php
/**
* The breaking div containing the main widget area
*
* @package arcHIVE-theme
* @since arcHIVE-theme 1.0.0
*/
?>
<section class="hero hero-announcement resources">
<?php dynamic_sidebar( 'announcement-resources-widgets' ); ?>
<aside>
<?php //insert menu here; ?>
<?php //foundationpress_announcement_bar(); ?>
</aside>
</section>

View File

@ -0,0 +1,72 @@
<?php
/**
* The section containing preview of resources
*
* @package arcHIVE-theme
* @since arcHIVE-theme 1.0.0
*/
?>
<?php
//https://developer.wordpress.org/reference/functions/get_template_part/#comment-4130
// var_dump( $args ); //will display everythin imported from
// get_template_part( 'template-parts/section', 'category', array('category_name' => 'news', 'post_per_page' => '3' ) );
$thiscustomposttype = $args['custom_post_type'];
$howmanyposts = $args['post_per_page'];
?>
<section class="archive-resources">
<header>
<h2>
<?php
if ( is_post_type_archive($thiscustomposttype) ):
//post_type_archive_title();
else:
echo $thiscustomposttype;
endif;?>
</h2>
</header>
<main class="">
<?php $the_query = new WP_Query( array( 'post_type' => $thiscustomposttype, 'posts_per_page' => $howmanyposts ) ); ?>
<?php if ( $the_query->have_posts() ) : ?>
<?php while ( $the_query->have_posts() ) : $the_query->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 ?>
<?php //pagination here ?>
<?php wp_reset_postdata(); ?>
<?php else : //if no post in query ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>
</main>
<aside>
<nav>
<!--a href="" class="button hollow">see more news</a-->
</nav>
</aside>
</section>