Skip to content

Instantly share code, notes, and snippets.

View bisteinoff's full-sized avatar

Denis BISTEINOV bisteinoff

View GitHub Profile
@Marinski
Marinski / WP Schema.org Breadcrumbs without Plugin
Last active March 23, 2024 17:01
WordPress Schema.org breadcrumbs without a plugin
function wordpress_breadcrumbs()
{
// Set variables for later use
$here_text = __( 'You are currently here' );
$home_link = home_url('/');
$home_text = __( 'Home' );
$link_before = '<span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">';
$link_after = '<meta itemprop="position" content="2" /></span>';
$link_attr = ' itemprop="item"';
$link = $link_before . '<span itemprop="name"><a' . $link_attr . ' href="%1$s">%2$s</a></span>' . $link_after;