I do adjustments to a wordpress theme and want to change the title output for a custom post type. To be precise, I want to remove Work Type
from it:
echo str_replace('Work Type ', '', wp_title(''));
Current output:
Work Type Title – What a site
Expected:
Title – What a site
Notes:
- Simply echoing
wp_title('')
results in the current output as well - If I do
wp_title()
I get Work Type » Title »
A problem is that your wp_title gives echo instead of return:
Look this wp_title() function:
https://core.trac.wordpress.org/browser/tags/3.9.1/src/wp-includes/general-template.php#L0
Your wp_title returns echo instead return so you need to change:
so…