WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] single_tag_title() but for custom taxonomy (3 posts)

  1. JMC Creative
    Member
    Posted 3 years ago #

    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.

  2. B Hays
    Member
    Posted 3 years ago #

    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.

  3. JMC Creative
    Member
    Posted 3 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic