Skip to content

Instantly share code, notes, and snippets.

@martellaj
Last active July 15, 2017 03:30
Show Gist options
  • Save martellaj/d1806bad502bf596a13e to your computer and use it in GitHub Desktop.
Save martellaj/d1806bad502bf596a13e to your computer and use it in GitHub Desktop.
Converted archive.php file (WordPress 4.3) for "Bootstrap to WordPress" Udemy course
<?php
/**
* The template for displaying archive pages.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package Bootstrap to WordPress
*/
get_header(); ?>
<?php if ( have_posts() ) : ?>
<section class="feature-image feature-image-default-alt" data-type="background" data-speed="2">
<h1>
<?php
the_archive_title();
the_archive_description( '<small class="taxonomy-description">', '</small>' );
?>
</h1>
</section>
<div class="container">
<div id="primary" class="row">
<main id="content" class="col-sm-8">
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'template-parts/content', get_post_format() );
?>
<?php endwhile; ?>
<?php the_posts_navigation(); ?>
<?php else : ?>
<?php get_template_part( 'template-parts/content', 'none' ); ?>
<?php endif; ?>
</main><!-- content -->
<!-- SIDEBAR
==================================== -->
<aside class="col-sm-4">
<?php get_sidebar(); ?>
</aside>
</div><!-- row -->
</div><!-- container -->
<?php get_footer(); ?>
@martellaj
Copy link
Author

Sorry for the ugly spacing... GitHub keeps reverting to 8 spaces even though I change it.

@BennLM75
Copy link

This was really useful, thanks for sharing 👍

@vfxguru001
Copy link

Thank you, sir! Really helped me.

@pablocolomban
Copy link

Awesome thanks!!

@AmbitiousTerror
Copy link

Thank you sir...You are a Star.....:-)

@seanchamanara
Copy link

THANK YOU!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment