Breadcrumbs for X Pro Header Builder

Roy AngerPosted:

Tags:

X Pro has been released, and with it the new Header and Footer builders. The tools are awesome. However, one thing missing (so far) are breadcrumbs. Here is a quick tip on getting breadcrumbs working.

First, make sure you have your X Pro Child Theme installed and activated. Once done, edit the functions.php file and add the following to it:


// Shortcode to add breadcrumbs to Header Builder
function my_breadcrumbs( ) {
        $breadcrumbs_on = x_get_option( 'x_breadcrumb_display' );
        if ( $breadcrumbs_on == '1' ) :
                $breadcrumbs = x_breadcrumbs();
        endif;
        return $breadcrumbs;
}
add_shortcode( 'breadcrumbs', 'my_breadcrumbs');

Once done, you can now use the shortcode [breadcrumbs] to display breadcrumbs in your header (or footer or anywhere on your site). In the Header builder all of the ‘content’ elements and the text element will work. Depending on where you place it, some of the stack’s CSS might need overriding to control the position.

Have a question or a comment about this article? Click here!
About the Author

Roy Anger

Hey everyone. I made my first website way back in about 95, before PHP, Wordpress, CSS and even tables. I love the flexibility and framework available in X, and love working with X on client sites. Aside from Wordpress, I love spending time with my two girls (girlfriend and chocolate Lab), trying to be a decent photographer and generally relaxing.

Share this Tip!

There are 12 comments

Your email address will not be published. Required fields are marked *