Community Forums › Forums › Archived Forums › General Discussion › Change BreadCrumb Schema Info
This topic is: not resolved
Tagged: breadcrumb, schema
- This topic has 2 replies, 2 voices, and was last updated 8 years, 7 months ago by
gera3d.
Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
May 12, 2017 at 4:05 pm #206358
gera3d
MemberHi everyone trying to deal with this issue maybe this group can help. I am trying to change some Schema info built into the theme.
<a href="http://aoms:8888/procedure/" itemprop="item"> <span itemprop="name">Procedures</span> </a>I want to change itemprop="item" to itemprop="url"
I am looking at this filter but it does not seem to change the itemprop
add_filter('genesis_breadcrumb_link', 'change_breadcrumbs_link'); function change_breadcrumbs_link( $link ) { }Here is the code I need to rewrite but I am not sure how to get the filter to work right. Your insight would be greatly appreciated.
http://aomsgen.staging.wpengine.com/procedure/dental-implants-amarillo-tx//** * Return anchor link for a single crumb. * * @since 1.5.0 * * @param string $url URL for href attribute. * @param string $title Title attribute. * @param string $content Linked content. * @param bool|string $sep Optional. Separator. Default is empty string. * * @return string HTML markup for anchor link and optional separator. */ protected function get_breadcrumb_link( $url, $title, $content, $sep = '' ) { // Empty title, for backward compatibility. $title = ''; $itemprop_item = genesis_html5() ? ' itemprop="item"' : ''; $itemprop_name = genesis_html5() ? ' itemprop="name"' : ''; $link = sprintf( '<a href="%s"%s><span%s>%s</span></a>', esc_attr( $url ), $itemprop_item, $itemprop_name, $content ); /** * Filter the anchor link for a single breadcrumb. * * @since 1.5.0 * * @param string $link HTML markup for anchor link, before optional separator is added. * @param string $url URL for href attribute. * @param string $title Title attribute. * @param string $content Link content. * @param array $args Arguments used to generate the breadcrumbs. Documented in Genesis_Breadcrumbs::get_output(). */ $link = apply_filters( 'genesis_breadcrumb_link', $link, $url, $title, $content, $this->args ); if ( genesis_html5() ) { $link = sprintf( '<span %s>', genesis_attr( 'breadcrumb-link-wrap' ) ) . $link . '</span>'; } if ( $sep ) { $link .= $sep; } return $link; }May 13, 2017 at 6:25 am #206376Victor Font
ModeratorTry this:
add_filter('genesis_breadcrumb_link', 'change_breadcrumbs_link'); function change_breadcrumbs_link( $link ) { return str_replace ( 'itemprop="item"' , 'itemprop="url"' , $link ); }
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?May 15, 2017 at 11:36 am #206479gera3d
MemberThis is just what I am looking for. You are the man thanks.
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
- The forum ‘General Discussion’ is closed to new topics and replies.