Skip to content

Instantly share code, notes, and snippets.

View rickrduncan's full-sized avatar

Rick R. Duncan rickrduncan

View GitHub Profile
<?php
//* Do NOT include the opening php tag
//* Reposition the Genesis breadcrumb to bottom of page
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
add_action( 'genesis_entry_footer', 'genesis_do_breadcrumbs' );
<?php
//* Do NOT include the opening php tag
//* Remove breadcrumb from a single page
//* https://codex.wordpress.org/Function_Reference/is_page
function b3m_remove_genesis_breadcrumb() {
if ( is_page( 'resources' ) ) {
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
}
}
<?php
//* Do NOT include the opening php tag
//* Prefix author breadcrumb trail with the text 'Articles written by'
function b3m_prefix_author_breadcrumb( $args ) {
$args['labels']['author'] = 'Articles written by ';
return $args;
<?php
//* Do NOT include the opening php tag
//* Change the breadcrumb separator
function b3m_change_breadcrumb_separator( $args ) {
$args['sep'] = ' &rsaquo; ';
return $args;
<?php
//* Do NOT include the opening php tag
//* Change the text at the front of breadcrumb trail
function b3m_home_text_breadcrumb( $args ) {
$args['home'] = 'CUSTOM TEXT HERE';
return $args;
<?php
//* Do NOT include the opening php tag
//* Remove 'You are here' from the front of breadcrumb trail
function b3m_prefix_breadcrumb( $args ) {
$args['labels']['prefix'] = '';
return $args;
}
<?php
//* Do NOT include the opening php tag
//* Default arguments from the Genesis Breadcrumb
//* genesis/lib/classes/breadcrumb.php
public function __construct() {
//* Default arguments
$this->args = array(
'home' => __( 'Home', 'genesis' ),
'sep' => __( ' <span aria-label="breadcrumb separator">/</span> ', 'genesis' ),
'list_sep' => ', ',
<?php
//* Do NOT include the opening php tag
//* Use dashicon for search button
//* http://melchoyce.github.io/dashicons/
add_filter( 'genesis_search_button_text', 'b3m_search_button_dashicon' );
function b3m_search_button_dashicon( $text ) {
return esc_attr( '&#xf179;' );
<?php
//* Do NOT include the opening php tag
//* Enqueue Dashicons
add_action( 'wp_enqueue_scripts', 'b3m_enqueue_dashicons' );
function b3m_enqueue_dashicons() {
wp_enqueue_style( 'dashicons' );
}