Forked from amboutwe/yoast_seo_breadcrumb_add_woo_shop.php
Created
October 23, 2024 18:11
-
-
Save isuke01/f32ee1729f75c1dd192170785095ff1a to your computer and use it in GitHub Desktop.
Multiple examples of how to customize the Yoast SEO breadcrumbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* Overwrite Rank Math breadcrumb shortcode with Yoast breadcrumbs | |
* Credit: Yoast team | |
* Last Tested: April 10, 2023 using Yoast SEO 20.4 on WordPress 6.2 | |
* Rank Math must be inactive to overwrite the shortcode | |
*/ | |
add_action('init', 'overwrite_rankmath_bc_shortcode_with_Yoast'); | |
function overwrite_rankmath_bc_shortcode_with_Yoast() { | |
add_shortcode('rank_math_breadcrumb', 'my_custom_wpseo_breadcrumb'); | |
} | |
function my_custom_wpseo_breadcrumb() { | |
return do_shortcode('[wpseo_breadcrumb]'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment