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

WP SITES

2665

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

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

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems