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

Reply To: [Waiting for user feedback] Filter taxonomy "Value set by the current page" not working (missing argument)

$
0
0

Hi Juan,

So, if I understand you correctly, we talk about the The_Loop here (http://codex.wordpress.org/The_Loop).
WordPress knows for some reason what content it needs to display on certain URL, is that what you mean with 'canonical query'? With the 'canonical query' the know what to show in the loop is how I understand it now.

Inside the loop we can use some template tags, like the_title or the_content for example. Since I learned that TVC toolset is hooking on to "the_content" I did the following.
In my child theme folder I made my own taxonomy-product_cat.php file, including only the following:

<?php

get_header(); ?>

	<?php the_content(); ?>

<?php get_footer();

In Views I made a content template that I assigned to Taxonomy Archives > Product categories.

In that content template I included my view with:

[wpv-view name="View for Product Categories"]

This view query's the products, and the filter I added should say: when you are on this category page only show products from this category (instead of all).

So, this is probably totally wrong what I was doing, so I had a look into the WordPress archives you mention.
For that, since the loop must be important there, I changed the taxonomy-product_cat.php file to:

<?php
get_header(); ?>

<?php 
	if ( have_posts() ) {
		while ( have_posts() ) {
			the_post(); 
			//
			the_content(); // Post Content here
			//
		} // end while
	} // end if
?>

<?php get_footer();

And indeed, I can change the output with WordPress Archives and it only outputs the products belonging to that category.

Questions left:

1) In what scenario, since it is possible to do, should I assign a Content template to Taxonomy Archives > Product categories. I just don't understand this yet… also, I now have the WordPress archieve that i created with views, but the content template is also still assigned to Taxonomy Archives > Product categories. It's only doing nothing as far as I can see.

2) With the above code it shows me all the products, but the page is not showing that category name as page title or is not showing the category description for example. Can I achieve this with TVC toolset, or do I need to change the taxonomy-product_cat.php file for that?

Kind regards,

Willem


Viewing all articles
Browse latest Browse all 20145

Trending Articles