Support » Plugin: Yoast SEO » [Plugin: WordPress SEO by Yoast] Breadcrumbs no longer allow HTML

  • Resolved Ian Anderson Gray

    (@baritoneuk)


    I updated all my sites to the latest version of the SEO plugin and found that all the breadcrumbs outputted the raw html.

    The SEO plugin used to allow html in the breadcrumb settings:
    Separator between breadcrumbs: <span class="divider">/</span></li><li>
    Anchor text for the Homepage: <i class="icon-home"></i> Home

    This allowed me to get my theme (based on Twitter Bootstrap) working the way I wanted (i.e. get breadcrumbs to output as a list and using a home icon button)

    I noticed previously that the breadcrumbs settings page didn’t like HTML and cut it off at the “, but it still worked really well on the front end.

    Now it seems that the breadcrumbs converts all the entities directly and so I can’t use HTML.
    http://wordpress.org/extend/plugins/wordpress-seo/

Viewing 13 replies - 1 through 13 (of 13 total)
  • Having the exact same issue

    Thread Starter Ian Anderson Gray

    (@baritoneuk)

    Just looked at the update log and seen that the Breadcrumbs has been completely rewritten and now use rich snippets – http://support.google.com/webmasters/bin/answer.py?hl=en&answer=185417

    I’m all for this and I think it’s a great idea. However, this is going to make it more difficult to customise and it still outputs without using a list. It would be great if there was a setting to allow to output as a list, choose a divider (eg. <span class="divider">/</span>) and allow html generally (for example putting a home icon for home eg <i class="icon-home"></i> Home

    I don’t think there is a work around at the moment for what I do as I can’t even turn rich snippets off (something I’d be reluctant to do, but would make things easier)

    I agree, I use(d) HTML in my separators. I think this is pretty critical to keep as a developer—without it limits how we can style the breadcrumbs.

    The problem is with /wordpress-seo/frontentd/class-breadcrumbs.php row 238

    replace

    $output .= esc_html( " $sep " );
    with
    $output .= " $sep " ;

    Thread Starter Ian Anderson Gray

    (@baritoneuk)

    Thanks, Thomask- works really well. I also had to change the link text and url lines to remove the esc_html bit:

    $link['text'] = $link['text'];
    $link['url']  = $link['url'];

    Thread Starter Ian Anderson Gray

    (@baritoneuk)

    I have to say I don’t really like changing the code of plugins over multiple sites- it’s a pain to manage- especially when an update comes along. Hopefully this can be looked into?

    i think that yoast will take it as other bug reports and will quickly resolve it. So take it just as a quick fix

    Plugin Contributor Joost de Valk

    (@joostdevalk)

    Hmm to be honest, I’m wondering why I would or would not allow HTML there… I’ll allow it back in in the next release.

    I told you – yoast is a king 😉

    Thread Starter Ian Anderson Gray

    (@baritoneuk)

    Fabulous! Really good news.

    I know there are different thoughts on this one, but what’s the thought on making the breadcrumbs outputted as an unordered list or at least giving the option of this?

    Any chance this will get remedied soon?

    Thread Starter Ian Anderson Gray

    (@baritoneuk)

    Ricky, what are you referring to? The HTML or it not being coded as a list? I haven’t looked recently, but does the plugin not allow HTML in the breadcrumbs? It’s a shame if it doesn’t. Ideally the plugin should allow more customisation for this.

    I can confirm that this escaping issue still exists in v1.4.6.

    I had the identical scenario, trying to use Font Awesome to render a Home icon using the HTML <i class="icon-home"></i>

    I fixed it by changing line 265 from

    $link_output .= '<a href="' . esc_url( $link['url'] ) . '" rel="v:url" property="v:title">' . esc_html( $link['text'] ) . '</a>';

    to
    $link_output .= '<a href="' . esc_url( $link['url'] ) . '" rel="v:url" property="v:title">' . $link['text'] . '</a>';

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘[Plugin: WordPress SEO by Yoast] Breadcrumbs no longer allow HTML’ is closed to new replies.