Skip to content

Instantly share code, notes, and snippets.

@abaicus
Last active November 26, 2018 20:15
Show Gist options
  • Save abaicus/24e4c08708ee2041cf199cc8ac95551b to your computer and use it in GitHub Desktop.
Save abaicus/24e4c08708ee2041cf199cc8ac95551b to your computer and use it in GitHub Desktop.
Adding Yoast breadcrumbs to the single post in Hestia / Hestia Pro. This should either be done in a child theme, or in a plugin.
<?php
/**
* Add Yoast breadcrumbs to Hestia Single Post.
*
* There are two ways to do this:
*
* 1. Create a child theme and add this snippet to your functions.php file.
* Check out the docs: https://docs.themeisle.com/article/656-how-to-create-a-child-theme-for-hestia
*
* 2. Create a folder called mu-plugins under your wp-content folder. Create a file called enhancements.php
* and paste the contents here inside it.
*
*/
function hestia_child_theme_yoast_breadcrumbs() {
if ( ! function_exists('yoast_breadcrumb') ) {
return;
}
yoast_breadcrumb( '<small id="breadcrumbs" style="margin-bottom: 20px; display: block;">','</small>' );
}
add_action( 'hestia_before_single_post_article', 'hestia_child_theme_yoast_breadcrumbs', 0 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment