Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

Reply To: [Assigned] Content template for product categories not working

$
0
0

OK Adriano, I think I can be a little bit proud on myself, so I hope I won't face any more problems!

I read the whole evening yesterday about template hierarchy on the wordpress codex. WooCommerce makes a custom post type 'Products', and for that reason they also have a archive-product.php in their template system. What I did, I made my own archive-product.php in my child theme folder, and replaced it with my own code:

<?php
/**
 * The template for displaying Archives. / product cpt
 *
 */
get_header(); ?>

	<?php if ( wpbootstrap_get_setting('titles_settings','display_archives_headers') ): ?>
		<h1 class="archive-title">
			<?php
				if ( is_day() ) :
					printf( __( 'Daily Archives: %s', 'wpbootstrap' ), get_the_date() );
				elseif ( is_month() ) :
					printf( __( 'Monthly Archives: %s', 'wpbootstrap' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'wpbootstrap' ) ) );
				elseif ( is_year() ) :
					printf( __( 'Yearly Archives: %s', 'wpbootstrap' ), get_the_date( _x( 'Y', 'yearly archives date format', 'wpbootstrap' ) ) );
				else :
					_e( 'Archives', 'wpbootstrap' );
				endif;
			?>
		</h1>
	<?php endif; ?>
	<?php the_content(); ?>
<?php get_footer();

As you can see I removed the loop, but still the_content I have included because that is where TVC is hooking on too. This way I could assign a content template to the product archives, which included a view of all the products I want to list.

No extra pages created :-) .


Viewing all articles
Browse latest Browse all 20145

Trending Articles