Spacious Theme – thumbnail based archive page
-
My goal is to have a thumbnail-based archive page which shows only the thumbnail and the post title in a grid on a separate archive page.
I am working on the spacious theme and already set up a child theme. Spacious already has a built-in archive.php but I couldnt chose it as template in the dashboard therefore I created a new file called archive-page.php in the child folder shich is an exact copy of the archive.php file and which I can adjust with the following code in it:
<?php
/*
Template Name: page-archive
*/
?><?php get_header(); ?>
<?php do_action( ‘spacious_before_body_content’ ); ?>
<div id=”primary”>
<div id=”content” class=”clearfix”><?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php if ( has_post_thumbnail()) : ?> ” title=”<?php
the_title_attribute(); ?>” >
<?php the_post_thumbnail(thumbnail, array(‘class’ => ‘alignleft’)); ?>
<?php endif; ?><?php get_template_part( ‘content’, get_post_format() ); ?>
<?php endwhile; ?>
<?php get_template_part( ‘navigation’, ‘archive’ ); ?>
<?php else : ?>
<?php get_template_part( ‘no-results’, ‘archive’ ); ?>
<?php endif; ?>
</div><!– #content –>
</div><!– #primary –><?php spacious_sidebar_select(); ?>
<?php do_action( ‘spacious_after_body_content’ ); ?>
<?php get_footer(); ?>
Now I can chose the archive template in the page section of the dashboard but of course it does not show the archive in the way I want it. Can someone help me with how I have to adapt the code (php) to make appear the thumbnails?
I would be very thankful for every help available (also links to tutorials or code snippets…)!
Thank you!
The topic ‘Spacious Theme – thumbnail based archive page’ is closed to new replies.
