WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] single_tag_title() but for custom taxonomy

[Resolved] single_tag_title() but for custom taxonomy

  • JMC Creative
    Member

    @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)
  • B Hays
    Member

    @benhays

    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.

    JMC Creative
    Member

    @jmc-creative

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

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