My categories are set up to display as a grid using the following code (category.php):
get_header(); ?>
<div id="content" class="site-content inner">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<!-- START OF THE FLEX CONTAINER, THE UNORDERED LIST -->
<ul class="grid-wrap">
<!-- WP LOOP STARTS HERE -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!-- LIST ITEM FOR EACH POST -->
<li class="grid-item">
<!-- FEATURED IMAGE FOR THE POST -->
<p>
<?php if ( has_post_thumbnail() ) : ?>
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'small' ); ?></a>
<?php endif; ?>
</p>
<!-- POST TITLE -->
<h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php endwhile; ?>
<?php endif; ?>
<!-- END OF THE LIST ITEM -->
</li>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>></div>
<!-- END OF THE FLEX CONTAINER -->
</ul>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_sidebar();
get_footer();
This is fine when filtering by category. I also want to have pages that shows the same category after some intro text, i.e.:
(header)
Some into text here
Grid display of posts (footer)
These pages will be linked from my header bar, not accessible through filtering. I've got as far as creating a template for each page, but how do I edit the category loop system to display just one category when it's on a page, not on the category's page? (if that makes sense).
I'm a total newbie to php and the wp loop, and am struggling with this. Thanks.