Skip to content

Instantly share code, notes, and snippets.

@wpexplorer
Created February 24, 2016 20:22
Show Gist options
  • Save wpexplorer/a3f58b5f32026e7fb106 to your computer and use it in GitHub Desktop.
Save wpexplorer/a3f58b5f32026e7fb106 to your computer and use it in GitHub Desktop.
Total theme custom archive.php template file example
<?php
/* Example custom archive template file */
// Get header
get_header(); ?>
<div id="content-wrap" class="container clr">
<?php wpex_hook_primary_before(); ?>
<div id="primary" class="content-area clr">
<?php wpex_hook_content_before(); ?>
<div id="content" class="site-content">
<?php wpex_hook_content_top(); ?>
<?php
// Display posts if there are in fact posts to display
if ( have_posts() ) :
// Start post loop
while ( have_posts() ) : the_post(); ?>
<?php
/* THIS IS WHERE YOUR ENTRY CODE SHOULD GO */ ?>
<?php endwhile; ?>
<?php
// Add this for pagination
wpex_pagination(); ?>
<?php
// Show message because there aren't any posts (optional)
else : ?>
<article class="clr"><?php esc_html_e( 'No Posts found.', 'total' ); ?></article>
<?php endif; ?>
<?php wpex_hook_content_bottom(); ?>
</div><!-- #content -->
<?php wpex_hook_content_after(); ?>
</div><!-- #primary -->
<?php wpex_hook_primary_after(); ?>
</div><!-- .container -->
<?php get_footer(); ?>
@wpexplorer
Copy link
Author

@joshcoast - that would be done via the wpex_post_layout_class filter.

Please post all support questions for this theme in the proper locations though - https://wpexplorer-themes.com/total/docs/how-to-request-support/ - if you need some help with a custom snippet for changing the layout on your custom template the developer can assist you there.

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