• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Placing a widget function inside the breadcrumb

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Placing a widget function inside the breadcrumb

This topic is: not resolved

Tagged: Add Widget, filter breadcrumbs

  • This topic has 3 replies, 2 voices, and was last updated 8 years, 9 months ago by mazeymaze.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • September 25, 2016 at 2:37 am #193662
    mazeymaze
    Member

    I have been searching for an answer but unfortunately I haven't found it yet, so here is my question.

    I want to add the posibility to place a widget inside the breadcrumb. I have a Genesis site with Agentpress Pro theme, and Woocommerce. For this I have added a YITH plugin "add to quote" which also has a small "mini-basket" widget that I would like to place in the right side inside the breadcrumb.

    This is what I got so far:

    genesis_register_sidebar( array(
    	'id'          => 'breadcrumbwidget',
    	'name'        => __( 'Breadcrumb', 'domain' ),
    	'description' => __( 'Add Content Here', 'domain' ),
    ) );
    
    add_action( 'genesis_before_content_sidebar_wrap', 'your_widget' );
    function your_widget() {
    if ( !is_front_page() && is_active_sidebar('breadcrumbwidget') ) {
    genesis_widget_area( 'breadcrumbwidget', array(
    'before' => '<div class="breadcrumbwidget widget-area">',
    'after'	 => '</div>',
    		) ); 
    }

    As you can see the placement "genesis_before_content_sidebar_wrap" is not correct, but I can't seem to find the hook that can add the widget inside the breadcrumb. Is there a hook that does that, or can I define it manually (or place it manually)?

    I really hope someone can help me out.

    The site is under construction, so a maintenance plugin is activated. You can login a view the page with:
    Username: viewer
    Password: kuhlmann123321

    Thanks in advance.

    Jens

    http://www.kuhlmann-heating.com
    September 25, 2016 at 3:18 am #193664
    Brad Dalton
    Participant

    Untested but maybe you can filter the breadcrumbs.

    You can use this to call the widget.

    genesis_widget_area( 'breadcrumbwidget' );

    Tutorials for StudioPress Themes.

    September 25, 2016 at 4:10 am #193665
    mazeymaze
    Member

    Hi braddalton,

    I am not sure that will work - for what I can see the filtering only has to do with the breadcrumb content - I would "simply" like to place a widget in the div-container that holds the breadcrumb.

    Like this:
    Placement of widget

    September 25, 2016 at 6:02 am #193667
    mazeymaze
    Member

    Hi again braddalton,

    I have tried to test what you suggested, and maybe it could work (I would just need some more help) 🙂

    This is the code I have pasted into my functions file and afterwards added the line of code you suggested to the $args['suffix'] part, so that the code is called at the end of the breadcrumb. It actually shows the widget that I'm after, but it messes up the site totally.

    I think you are very close to solving my issue - I hope you will help me out. Just as an extra, the widget does not mess the site up when placed elsewhere, so there must be some sort of failure in what I'm doing when wanting to place it inside this div container.

    genesis_register_sidebar( array(
    	'id'          => 'breadcrumbwidget',
    	'name'        => __( 'Breadcrumb', 'domain' ),
    	'description' => __( 'Add Content Here', 'domain' ),
    ) );
    
    add_action( 'genesis_do_breadcrumbs', 'your_widget' );
    function your_widget() {
    if ( !is_front_page() && is_active_sidebar('breadcrumbwidget') ) {
    genesis_widget_area( 'breadcrumbwidget', array(
    'before' => '<div class="breadcrumbwidget widget-area" align="right">',
    'after'	 => '</div>',
    		) ); 
    
      }
    
    }
    
    //* Modify breadcrumb arguments.
    add_filter( 'genesis_breadcrumb_args', 'sp_breadcrumb_args' );
    function sp_breadcrumb_args( $args ) {
    	$args['home'] = 'Home';
    	$args['sep'] = ' / ';
    	$args['list_sep'] = ', '; // Genesis 1.5 and later
    	$args['prefix'] = '<div class="breadcrumb">';
    	$args['suffix'] = genesis_widget_area( 'breadcrumbwidget' );'</div>';
    	$args['heirarchial_attachments'] = true; // Genesis 1.5 and later
    	$args['heirarchial_categories'] = true; // Genesis 1.5 and later
    	$args['display'] = true;
    	$args['labels']['prefix'] = 'You are here: ';
    	$args['labels']['author'] = 'Archives for ';
    	$args['labels']['category'] = 'Archives for '; // Genesis 1.6 and later
    	$args['labels']['tag'] = 'Archives for ';
    	$args['labels']['date'] = 'Archives for ';
    	$args['labels']['search'] = 'Search for ';
    	$args['labels']['tax'] = 'Archives for ';
    	$args['labels']['post_type'] = 'Archives for ';
    	$args['labels']['404'] = 'Not found: '; // Genesis 1.5 and later
    return $args;
    }
    

    The visual result looks like this:

    Result

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble