I have jobs custom post type which contains custom taxonomies

  • Location
  • Company
  • State
  • Qualification

and added custom fields

  • Name of company - text field
  • Post Name - text field
  • Number of posts - number field
  • qualification - text field
  • Last Date - text field more
  • details - text field(Post link)

now how can i add these custom fields of custom post type in a custom taxonomy template.

In custom taxonomy template these fields should be displayed in a table.

closed as unclear what you're asking by Jacob Peattie, cjbj, bueltge, Jack Johansson, EAMann Jan 7 '18 at 16:56

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


Not sure what the exact query is but these fields can be accessed on the taxonomy template in the same way as they are accessed elsewhere - using get_post_meta().

The code in your taxonomy template has a part which loops through all the relevant posts and gives back the info. You can sort the post ID from it and use it in get_post_meta()

Sorry if this is not what you are looking for.

EDIT (Code Added)

if ( have_posts() ) :

        while ( have_posts() ) : the_post();

            echo $company_name = get_post_meta( get_the_ID(), 'name-of-company', true );

  • sid@ can you please give me template code – Harsha Dec 20 '17 at 9:33
  • It will be tough without knowing how your taxonomy template is structured. I still have edited my answer to add a basic structure of code. See it it helps – Sid Dec 20 '17 at 10:28
  • thanks sid, but i want to display custom fields loop in table in archive template like this [link[(imgur.com/a/Lsyqj) – Harsha Dec 20 '17 at 10:52
  • yes. Using the code in my answer you could populate all the custom fields associated with a post. You can add the table styling as you like with it. – Sid Dec 20 '17 at 11:23

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