Hi Willem
Glad to see we are getting somewhere. Let me give you some hints here:
1. Your old PHP template.
You had something like:
<?php get_header(); ?> <?php the_content(); ?> <?php get_footer();
You need to understand why it does not work, and I think you did. Every WordPress template showing elements needs to have a loop. In a single post, the loop will only display the current item.In a page showing a list of items, each loop iteration displays one item.
You seemed to understand that in the taxonomy archive page, you could only display one Template, meaning there was only one execution of the loop,and show your View listing your item inside that Template. But that is not the case. Below I will explain what the WordPress Archives and Content Templates for archive loops mean, do not worry.
Your new taxonomy-product_cat.php file is now what it should be. It load the header and the footer of the page, and a lop for each element. By default, and taking the information from the URL, WordPress knows that you are loading a term in the Product Cat taxonomy, so it loads this PHP template and applies it to show only posts that belong to that term. You do not need to do anything there.
2. Now, to customize the output of that listing page, and answering your questions.
a) You can asign a WordPress Archive from Views *or* a Content Template to an archive page. If you create both, the WordPress Archive will take higher priority, so it will be used. They are two different objects. The WordPress Archive "replaces" the current loop generated in your PHP template with the one in this WordPress Archive layout section. The Content Temlate replaces just the the_content() call, but nothing around it. Let me use an example:
Imagine your PHP template is like this:
<?php get_header(); ?> <?php if ( have_posts() ) { while ( have_posts() ) { the_post(); // the_title(); the_content(); // Post Content here // } // end while } // end if ?> <?php get_footer();
Mind that I added a the_title() call, to display the product title. Using a WordPress Archive, you would overwrite everything inside the loop, so you would need to add the title to the WordPress Archive layout loop again if you want to output it. But using a Template, the title would be shown and only the content would be replaced.
Of course,you can use them together. But in this case, you need to add your Template to the WordPress Archive loop. You have a button there to add existing Content Templates: just click it and add it where you need it.
b) There are two ways that you can use to display the category name or description. The first one is using PHP functions in your PHP template. But the second one lets you do it in Views without coding. If you are using a WprdPress Archive to display this page, look in this layout section, something like that:
[wpv-layout-start] [wpv-items-found] [wpv-taxonomy-archive info="name"] [wpv-taxonomy-archive info="description"] <!-- wpv-loop-start --> <wpv-loop> Here comes what you want to show in that page for even item, or even your Template using [wpv-post-body view_template="your template name"] </wpv-loop> <!-- wpv-loop-end --> [/wpv-items-found] [wpv-no-items-found] [wpml-string context="wpv-views"]<strong>No items found</strong>[/wpml-string] [/wpv-no-items-found] [wpv-layout-end]
Mind that I added the wpv-taxonomy-archive shortcode:
http://wp-types.com/documentation/views-shortcodes/#vf-154477
and (this is important) it was used outside the layout loop, so it only displays once. Using the info attribute, you can display the name, the description and even the post count for that category.
Hope it helps. Let me know if I can help you with anything else.
Regards,
Juan de Paco