Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using jigoshop as main ecommerce plugin.

Jigoshop use Taxonomies call, product_cat and product_tag.

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

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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.

share|improve this answer
    
Great solutions , thanks. –  Locke Jan 25 '13 at 7:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.