6

I guess I would like to be able to include HTML tags within the title so that when the title is listed certain words are bolded.

Is this possible? When I try to put HTML into the title, the tag itself is output (escaped) in the final page list.

4
  • never tried this personally, but I think you could probably build a "filter" to do this for you. Maybe something in this support thread will help: wordpress.org/support/topic/… – Zach Lysobey Dec 25 '12 at 21:16
  • alternatively, you could just use a custom meta field (with html) which you could code to take precedence over the title if present. – Zach Lysobey Dec 25 '12 at 21:18
  • Zach, that's what I ended up doing, was a cinch. Just learning WP so thanks for answering an obvious question. – brushleaf Dec 25 '12 at 23:28
  • glad to be of help ;-) good luck in your future WordPressin' – Zach Lysobey Dec 25 '12 at 23:35
3

Yes, you can use HTML elements in post titles by default. If your output is escaped a plugin or theme might have touched that. Disable all plugins and switch to TwentyEleven. This will help you to identify the source.

Note that markup is stripped in some places where it is not allowed: title attributes and elements, feed markup, nav menus. You should not break that.

Also make sure your markup is valid and allowed for your user role. The kses filter will try to remove it otherwise.

1
  • Turns out that my theme was escaping it. I have moved to using a custom meta tag since I want the title to appear normal in other instances. – brushleaf Dec 25 '12 at 23:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.