Skip to content

Instantly share code, notes, and snippets.

@abaicus
Last active November 26, 2018 20:15
Show Gist options
  • Select an option

  • Save abaicus/24e4c08708ee2041cf199cc8ac95551b to your computer and use it in GitHub Desktop.

Select an option

Save abaicus/24e4c08708ee2041cf199cc8ac95551b to your computer and use it in GitHub Desktop.

Revisions

  1. abaicus revised this gist Nov 26, 2018. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion hestia-yoast-breadcrumbs.php
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,16 @@
    <?php

    /**
    * Add yoast breadcrumbs to Hestia Single Post.
    * 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') ) {
  2. abaicus created this gist Nov 26, 2018.
    12 changes: 12 additions & 0 deletions hestia-yoast-breadcrumbs.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@

    /**
    * Add yoast breadcrumbs to Hestia Single Post.
    */
    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 );