I have custom taxonomy term pages which I'm using to override forum pages and I want to emulate advanced forum node/add/forum/tid button so I have to get tid but don't know how, I can only find examples on how to print tid of the current node.
You can use below code to get Taxonomy id by Taxonomy Name
$taxonomy_term = taxonomy_get_term_by_name('Taxonomy Term Name');
$tid = $taxonomy_term>tid;
-
No it's not working at all, I tried this but it didn't work either <?php print $term->tid; ?>"> – drupaluser Jun 3 '15 at 18:27
You can use taxonomy_get_term_by_name and use arg(3) (those are the URL args find out more about those here in the docs) or something similar to pull the name. That function should return an array of match term objects. There should be more information on the taxonomy.module docs that could help as well, you can find them here: https://api.drupal.org/api/drupal/modules%21taxonomy%21taxonomy.module/6
I have experience in D6 but not as much as D7 but something like that should work or a custom query but I'd advise against those since there is already a function for it in the API.