0

I have tried contacting the developer of a plugin 'WP Broadbean' but the plugin basically creates a custom post type with various taxonomies.

One of which is 'Industries' - This is almost like a category for the jobs posted but I am going to assume it is a taxonomy rather than a category.

The Problem I am having is that the main template for /jobs to show all jobs regardless of taxonomy/category is a file named: archive-wpbb_job.php

A single view for a job is a file named: single-wpbb_job.php

When you apply a 'industry' to a job post the url then becomes /job-industry/taxonomy-title

The page by default falls back to archive.php if this is is blank/missing it routes to index.php but I require those pages for the native blog so I am struggling to create a custom template to handle the jobs when they are being viewd under a taxanomy/category.

For instance, one of my industries is called 'accounts' so I am wondering how I am able to create a template file, I have so many ways here are are a handful to name a few...

  • taxonomy-wpbb_job.php
  • taxonomy-wpbb_job_industry.php
  • archive-wpbb_job_industry.php
  • category-wpbb_job.php
  • category-wpbb_job_industry.php

I have tried to understand how the url should be structured by using both of these resources:

https://wphierarchy.com/

So to conclude, I need to create a file to handle the template for these taxonomies so I can free up index.php and archive.php as I really don;t want to be relying on those.

I have been trying for a couple of hours now and just do not seem to be getting anywhere...

Just as an update, here is a screenshot of a file called taxonomies.php within the plugins directory:

[![enter image description here][1]][1]

So here are some examples of the job categories pages:

The above is being served from index.php

The above pages are treating archive.php as its native template.

MAJOR UPDATE

First off all, credit goes to the Gentleman who provided the answer below. After much going back and forth via an alternative chat channel we discovered it was an issue with some code in another plugin! 'User Tags for Wordpress'

  • I did summarise, read the question the bold part – danjbh May 17 '17 at 12:59
  • @toscho is there anything you are able to help with here? – danjbh May 17 '17 at 13:02
  • what is the actual slug the taxonomy is registered with? That's will determine the correct template name. The plugin author is the best place to ask this. – Milo May 17 '17 at 13:10
  • @Milo 'The plugin author is the best place to ask this' - First sentence in my post. what is the actual slug the taxonomy is registered with? - I can only assume the slug is: job-industry as that what is automatically created. Did you read any of the question? – danjbh May 17 '17 at 13:12
  • Have you tried taxonomy-job-industry.php? The URL slug above is job-industry – Tom J Nowell May 17 '17 at 14:23
0

The template isn't determined by the URL, it's taxonom-{taxonomy_slug}.php

See here for the full template hierarchy:

https://developer.wordpress.org/themes/basics/template-hierarchy/

And a visual representation:

https://wphierarchy.com/

enter image description here

Final Note on Terminology

There's a difference between taxonomies and terms, and muddling the two words or always referring to them as taxonomies will get confusing very quickly.

For example 'accounts' would be a term in a taxonomy named Industries.

To find out what your Industry taxonomy is named internally ( its slug if you will ), you'll need to look inside the WP Broadbean code for the location it is registered

  • Thanks for you answer but you have regurgitated my question in a round-a-bout way. I never mentioned that terms and taxonomies where confusing me...? I simply am unable to override why this taxonomy is defaulting back to archive.php and if not available index.php. The taxonomy is called - wpbb_job_industry and there could be an infinite number of terms in there. – danjbh May 17 '17 at 13:44
  • Please see my screen attachment in my question update. – danjbh May 17 '17 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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