0

I am new to word press, I want to display results on a page which belong to some group from database(I have group column). I think this can be done by taxonomy so I have taxonomy table but I don't know what to write in taxonomy.php file, any idea what is the minimum information that I have to write in taxonomy.php to make it work.

6
  • What have you tried so far? What table is the group column in? A custom table? If so, taxonomies will have no relation to it whatsoever unless you define them at the database level. May 16 '13 at 18:05
  • @Andrew I want to display few rows from database which belong to some group on the front end of a page. I have 3 groups G1,G2 and G3 and three hyperlinks for these, when ever a user click G1 it goes to new page which shows all rows belong to group G1 and so on. I tried - baseUrl/my_taxonomy_name_from_table(wp_term_taxonomy)/G1 but it gives url not found and I have not configured or done any thing other then creating taxonomy page in them which just display posts. May 16 '13 at 18:07
  • Please delete this answer and reply to my comment, but as I asked, how are you storing these groups in the database? See @elkirkmo's answer for how to register a taxonomy. May 16 '13 at 18:22
  • I am not able to see reply tag above after your ans. DB creation was done by some one else so I dont have much idea, there is one group column in my main data table which have G1.. G3 entries and there is one row for group in wp_term_taxonomy. May 16 '13 at 18:38
  • Just click "Add Comment". Can you create the schema here please: sqlfiddle.com May 16 '13 at 18:39
0

Taxonomy.php is the default template that displays how custom taxonomies display in the browser. They aren't how you create a new taxonomy. This is done by using the function register_taxonomy() in functions.php. Wordpress has created a whole codex page on the topic available here. SmashingMag has a great tutorial on it as well (it's actually what I used to learn how to build custom taxonomies.

Hope this helps.

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.