Making breadcrumb with wp_nav_menu

I couldn’t believe there is not a single FREE plugin available that does this. So I wrote my own function. Here you go. Just copy this to your functions.php: function my_breadcrumb($theme_location = ‘main’, $separator=” > “) { $theme_locations = get_nav_menu_locations(); if( ! isset( $theme_locations[ $theme_location ] ) ) { return ”; } $items = wp_get_nav_menu_items( … Read more

How to add a page to the Yoast breadcrumbs

Here’s the general principle of what you need to do: Hook into the wpseo_breadcrumb_links or wp_seo_get_bc_ancestors API filters. Add your Blog into the WordPress SEO Breadcrumb $links array, using array_splice. Place this in your theme’s functions.php: /** * Conditionally Override Yoast SEO Breadcrumb Trail * http://plugins.svn.wordpress.org/wordpress-seo/trunk/frontend/class-breadcrumbs.php * ———————————————————————————– */ add_filter( ‘wpseo_breadcrumb_links’, ‘wpse_100012_override_yoast_breadcrumb_trail’ ); function wpse_100012_override_yoast_breadcrumb_trail( … Read more