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 9 years, 5 months ago by
SRD.
Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
December 17, 2016 at 2:12 am #197723
SRD
MemberFrom 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 #197731Victor Font
ModeratorThe 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 #197793SRD
MemberExcellent, thank you kindly Victor.
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.