Support » Fixing WordPress » single_tag_title() but for custom taxonomy

  • Resolved JMC Creative


    The title pretty much says it all. On an archive page for a custom taxonomy, is there a way to get the single name of the tax? Just like single_tag_title(), but for the custom taxonomy.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’ve been looking for the same thing, but ended up writing my own function to modify wp_title(). It splits the returned wp_title and displays just the last part after the separator.

    function custom_tax_title() {
    	echo end(explode('|', wp_title('|',false,'')));

    Put this in your functions.php, then call custom_tax_title() and you should be good to go.

    ding! Thank you very much, exactly what I needed.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘single_tag_title() but for custom taxonomy’ is closed to new replies.