Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

Marj Wyatt on "How to isolate posts in custom taxonomy?"

$
0
0

I'm wrapping up a custom theme for a client and I want to add filters to the archives for proper formatting of product data.

The custom post types are properly associating with their custom taxonomies, which are cateogories. The rewrite slug is product-type.

I'm using this in functions.php to filter the microformates and it is working for the conditions that I've listed

//Filter Microdata for Products
function vm_attributes_content( $attributes ) {
	//* Product microdata
	if ( is_singular( 'product' ) || is_post_type_archive( 'product' ) || is_home() ) {
		$attributes['itemscope'] = 'itemscope';
		$attributes['itemtype']  = 'http://schema.org/Product';
	}
	return $attributes;
}
add_filter( 'genesis_attr_content', 'vm_attributes_content' );

I tested and found that is_taxonomy() is applying the desired filters to the archives but I am aware that this function has been deprecated so I'm not sure what will replace it.

What is the alternative?


Viewing all articles
Browse latest Browse all 8245

Trending Articles