0

I have registered a custom taxonomy wfa_book_genres through plugin and the slug name for this taxonomy is genres.

Now i want to include archive template from plugin folder for my custom taxonomy. I tried to use below examples code but it shows completely blank when goes to that archive term. I don't know how to solve this issue. I am really stuck here:

add_filter('template_include', 'wfa_taxonomy_template');
function wfa_taxonomy_template( $template ){

 /*
  // if wfa_book_genres taxonomy
  if( is_tax('wfa_book_genres')){
    $template = plugin_dir_url(__FILE__ ).'taxonomy-wfa_book_genres.php';
   }
  */

  // if wfa_book_genres taxonomy slug
  if( is_tax('genres')){
    $template = plugin_dir_url(__FILE__ ).'taxonomy-wfa_book_genres.php';
  }  
  return $template;
 }
Mehedi Hasan
  • 77
  • 1
  • 9

1 Answers1

0

change plugin_dir_url with dirname:

    $template = dirname(__FILE__ ).'taxonomy-wfa_book_genres.php';
Bhumi Shah
  • 9,323
  • 7
  • 63
  • 104
  • Hi Bhumi, i changed it but still same issue. When the taxonomy archive page open its shows completely blank. Without condition i included this template also, but no luck :( – Mehedi Hasan Dec 03 '14 at 13:23