Wordpress taxonomy template exclude terms -


i have custom taxonomy. lists of terms in taxonomy dynamically created.

i have custom template taxonomy taxonomy-{custom-template}.php, not want use same template terms page.

i not able create template terms upfront taxonomy-{custom-template}-{term}.php terms created dynamically.

is there option exclude or have generic template terms?

i'd use is_tax() in taxonomy-{custom-template}.php determine whether displaying archive page or terms page, , them include relevant code in template parts.

  1. create 2 new template parts in template parts folder - lets called partials

    • one taxonomy archive page e.g. tax_archive_content.php. copy archive-specific code taxonomy-{custom-template}.php it.
    • the other terms page - e.g. tax_terms_content.php. put new code handling terms in here.
  2. add following taxonomy-{custom-template}.php

(this replace archive-specific code moved tax_archive_content.php)

if (is_tax())     get_template_part('partial/tax_archive_content');  else     get_template_part('partial/tax_terms_content');  

references is_tax:


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -