Genesis Breadcrumbs On Specific Pages

Wordpress PHP net

Breadcrumbs are more than a culinary delight. They also provide a secondary navigation aid for users on a website or application. They are probably not useful on ‘simple’ websites with only several layers of navigation. On large and complex websites, such a an eCommerce website, breadcrumbs might be a benefit to the user. I would suggest constructing a ‘site map’ to determine whether breadcrumbs would improve the user experience. Consider this eCommerce website as an example.

It is probable you would not want breadcrumbs on the the entire website, but only on specific pages. Is so, you might design your page and navigation layout so you want breadcrumbs on a page and it’s subpages. In Genesis it is easy, since breadcrumbs are already built in. Just input your page and subpages and insert the code in your child theme’s function.php file to modify the breadcrumbs.

* Breadcrumbs On Specific Pages Only
* @author Doak Heggeness
* @link
* @param string original breadcrumb
* @param string modified breadcrumb
* Fill the is_page array with slugs of all the pages/sub-pages which should have breadcrumbs.
function dh_add_page_crumb() {
if ( !is_page( array( ‘sample-page’, ‘child’ ) ) ) {
remove_action( ‘genesis_before_loop’, ‘genesis_do_breadcrumbs’ );
add_action( ‘template_redirect’, ‘dh_add_page_crumb’ );