• 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

Altered prefix for breadcrumb in child theme functions.php does not display

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 › Altered prefix for breadcrumb in child theme functions.php does not display

This topic is: not resolved

Tagged: breadcrumb, breadcrumbs, child theme, functions.php

  • This topic has 2 replies, 2 voices, and was last updated 6 years, 3 months ago by SRD.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • December 17, 2016 at 2:12 am #197723
    SRD
    Member

    From this page, I've added the following to my child theme's functions.php:

    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'] = '</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'] = '';
    	$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;
    }
    
    add_filter( 'genesis_breadcrumb_args', 'sp_breadcrumb_args' );

    However, the front end still displays the following in the breadcrumb area:

    You are here: Home / About

    Note: it still contains the text "You are here: ", and has not been overridden by

    $args['labels']['prefix'] = '';

    Why is this the case please?

    http://amalfi.madhatmedia.com.au/about/
    December 17, 2016 at 8:10 am #197731
    Victor Font
    Moderator

    The code has been updated a bit in Genesis. Try this:

    add_filter( 'genesis_breadcrumb_args', 'reset_breadcrumbs' );
    function reset_breadcrumbs( $args ) {
    	$args = array(
    		'home'                    => __( 'Home', 'genesis' ),
    		'sep'                     => __( ' <span aria-label="breadcrumb separator">/</span> ', 'genesis' ),
    		'list_sep'                => ', ',
    		'prefix'                  => sprintf( '<div %s>', genesis_attr( 'breadcrumb' ) ),
    		'suffix'                  => '</div>',
    		'heirarchial_attachments' => true,
    		'heirarchial_categories'  => true,
    		'labels' => array(
    			'prefix'    => __( '', 'genesis' ),
    			'author'    => __( 'Archives for ', 'genesis' ),
    			'category'  => __( 'Archives for ', 'genesis' ),
    			'tag'       => __( 'Archives for ', 'genesis' ),
    			'date'      => __( 'Archives for ', 'genesis' ),
    			'search'    => __( 'Search for ', 'genesis' ),
    			'tax'       => __( 'Archives for ', 'genesis' ),
    			'post_type' => __( 'Archives for ', 'genesis' ),
    			'404'       => __( 'Not found: ', 'genesis' ),
    		)
    	);
    
    	return $args;
    
    }

    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    December 18, 2016 at 8:11 pm #197793
    SRD
    Member

    Excellent, thank you kindly Victor.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 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

© 2023 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