• Resolved carlla

    (@carlla)


    Anyone could please point me if there is a function (or a global var) to get the taxonomy id once on taxonomy(-sometaxonomy).php ?

    Sorry if it isn’t a smart question. I didn’t find it on neither codex nor forum. Google don’t help me too.

    Any ideia?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter carlla

    (@carlla)

    ok, I found out how to do that. Now I can use the texonomy id on my custom taxonomy template.

    // Template: themes/mytheme/taxonomy.php
    global $wp_query;
    $tag = $wp_query->get_queried_object();
    
    echo "My taxonomy : <br /> <pre>";
    var_dump($tag);
    echo "</pre>";
    
    echo "<br /> Taxonomy id: ".$tag->term_id;

    Simple like that! How couldn’t I find it before?

    thanks a lot for posting this. works like a charm and does just what i need it to do! (put out the term id via taxonomy.php)

    Thanks for posting this. I wasted 4 hours trying to do it and here you saved me a lot of time!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘print taxonomy id on taxonomy.php’ is closed to new replies.