Hi there I am trying to open a specific single.php if specific "slugs" are forwarded from my taxonomy.
I did this with author:
<?php $post = $wp_query->post;
if(get_the_author_meta('user_nicename', $post->post_author) == 'name') {
/* Do your author-specific work */
include(TEMPLATEPATH . '/single-coupon-1.php');
} else {
include(TEMPLATEPATH . '/single-coupon-2.php');
}
?>
but i need this for my taxonomy
my taxonomy is
<?php echo appthemes_get_custom_taxonomy($post->ID, APP_TAX_STORE, 'slug'); ?>
now if the slug is (just an example) "amazon" the single-coupon-2.php should be used.
I tryed a lot but always getting errors! And right now I am lost in confusion ;-)...
Thanks and any help is appreciated!
I'm not sure if I have misunderstood your question, but WordPress provides a template hierarchy so you can create templates for specific pages.
Just create a taxonomy-myslug.php in your theme file and WordPress will pick it out automatically.
If there is commonality between different templates, use get_template_part() to ensure you only code once.