Community Forums › Forums › Archived Forums › General Discussion › Breadcrumbs showing html markup for superscript – want to hide html
Tagged: breadcrumbs
- This topic has 5 replies, 2 voices, and was last updated 11 years, 3 months ago by
Badlywired.
-
AuthorPosts
-
January 13, 2015 at 11:03 am #137327
csbeck
MemberI've got a site under development:
When going to this page, the breadcrumb shows the HTML markup for making the registered mark superscripted:
It's strange because when the breadcrumb is not a link, the title looks correct (without the HTML markup).
Does anyone know how to make the breadcrumb links appear without the HTML markup?
Thanks!
http://cortera.beckerstudio.com/products/ecredit/ecredit-enterprise-creditJanuary 14, 2015 at 4:40 pm #137490csbeck
MemberChecking again to see if anyone has an ideas about this.
January 15, 2015 at 8:01 am #137529Badlywired
MemberAdding this to your functions.php should do it
// filter to allow <sup> tag through esc_html add_filter('esc_html', 'bw_esc_html',10,2); function bw_esc_html($val, $text, $content = null) { $text = wp_check_invalid_utf8( $text ); return wp_kses($text, array ( 'sup' => array())); }Obviously use at your own risk.
Detailed explanation of your issue here -> http://badlywired.com/2015/genesis-breadcrumbs-markup/
My techy blog WordPress and stuff badlywired.com
January 15, 2015 at 10:23 am #137555Badlywired
Memberp.s. I also raised this with StudioPress and they gave two other work arounds
......................... this is what they say --------For now, another workaround you are welcome to use that filters Genesis breadcrumb links only and not esc_html throughout WordPress is this:
add_filter( 'genesis_breadcrumb_link', 'sp_html_crumbs', 10, 4 ); function sp_html_crumbs( $link, $url, $title, $content ) { $link = sprintf( '<a href="%s"%s>%s</a>', esc_attr( $url ), $title, $content ); return $link; }If you prefer, you can also solve the issue without writing code by installing the WordPress SEO plugin and activating breadcrumbs under SEO > Internal Links (http://d.pr/i/19y2Y ). This works because WordPress SEO doesn't escape HTML in breadcrumb links by default like Genesis does. (That may change in the future, though.)
My techy blog WordPress and stuff badlywired.com
January 15, 2015 at 10:32 am #137556csbeck
MemberThat did it. Thanks so much Badlywired.
So can you imagine any way that it would "harm" a site? Checked the site and everything seems ok - for now.
Thanks again!January 15, 2015 at 11:06 am #137560Badlywired
MemberI can't think of anyway. But it is altering the behaviour of esc_html across the site (unless you use StudioPresses version), so there is a REMOTE chance that some HTML slips through that shouldn't somewhere and your site formatting gets screwed up, so hence not accepting any liability 🙂
My techy blog WordPress and stuff badlywired.com
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.