• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

Shortcode For Breadcrumbs

This PHP code creates a very basic shortcode for displaying breadcrumbs in Genesis.

The reason i coded this is because a member wanted to float the breadcrumbs over a background image for a widgets like you see in the following image:

breadcrumbs-shortcode

Here’s the code:

This 1st snippet should be added to your child themes functions file and creates a shortcode named [breadcrumbs] you can use in a text widget or your wp editor.

add_shortcode( 'breadcrumbs', 'breadcrumbs_shortcode' );

function breadcrumbs_shortcode() {

	return genesis_breadcrumb();

}

This 2nd snippet adds support for using shortcodes in text widgets:

add_filter( 'widget_text', 'do_shortcode' );

And the 3rd snippet enables you to remove the shortcodes output using the Genesis > Theme Settings.

remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );

Style Breadcrumbs

Modify your themes existing CSS for breadcrumbs.

.breadcrumb {
    background-color: transparent!important;
}

Related Tutorials

  • Modify Genesis Breadcrumbs

Breadcrumbs

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.