Taxonomy Tag Conditionals

I’m using jigoshop as main ecommerce plugin.

Jigoshop use Taxonomies call, product_cat and product_tag.

Read More

In my theme I use a default (h5bp) 404.php, so every time a tag doesn’t exist I get the default 404.

But I need to have a special template that give a THIS TAG DO NOT EXIST

how can I do this?

I’m using pointless:

@@@
<?php

if (is_tax()){
    jigoshop_get_template( 'product_taxonomy-no.php' );
}else{
 jigoshop_get_template( 'product_taxonomy-no.php' );
}
?>
@@@

thanks

Related posts

Leave a Reply

1 comment

  1. If you want to use an entirely different template, you could filter 404_template and check query vars for a specific taxonomy:

    function wpa83050_404_template( $template = '' ){
        global $wp_query;
        if( isset( $wp_query->query_vars['product_cat'] ) )
            $template = locate_template( array( "product_taxonomy-no.php", $template ), false );
        return $template;
    }
    add_filter( '404_template', 'wpa83050_404_template' );
    

    You could also just put logic similar to the above in your 404 template and use that single template for all 404s, check $wp_query for what query vars are set and print some text accordingly. add var_dump( $wp_query ); to your template to see what query vars get set under different conditions.