Instantly share code, notes, and snippets.
Website Optimization & Analytics Professional
-
B3Marketing, LLC
- Richmond, VA USA
- http://rickrduncan.com/about
rickrduncan
/ genesis-breadcrumb-relocate.php
Created
November 8, 2015 12:33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ); |
rickrduncan
/ genesis-breadcrumb-remove.php
Created
November 8, 2015 12:32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ); | |
} | |
} |
rickrduncan
/ genesis-breadcrumb-author-label.php
Created
November 8, 2015 12:30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
rickrduncan
/ genesis-breadcrumb-separator.php
Last active
November 8, 2015 12:24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Do NOT include the opening php tag | |
//* Change the breadcrumb separator | |
function b3m_change_breadcrumb_separator( $args ) { | |
$args['sep'] = ' › '; | |
return $args; |
rickrduncan
/ genesis-breadcrumb-home-link.php
Created
November 8, 2015 12:02
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Do NOT include the opening php tag | |
//* Change the 'Home' link to point to a different URL | |
function b3m_breadcrumb_home_link( $crumb ) { | |
return preg_replace('/href="[^"]*"/', 'href="http://www.rickrduncan.com"', $crumb); | |
} | |
add_filter ( 'genesis_home_crumb', 'b3m_breadcrumb_home_link' ); |
rickrduncan
/ genesis-home-text-breadcrumb.php
Created
November 8, 2015 12:00
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
rickrduncan
/ genesis-breadcrumb-prefix.php
Last active
November 7, 2015 14:31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} |
rickrduncan
/ genesis-breadcrumb-args.php
Last active
January 15, 2016 13:27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' => ', ', |
rickrduncan
/ dashicon-search-button-genesis.php
Last active
January 17, 2016 12:45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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( '' ); | |
rickrduncan
/ enqueue-dashicons.php
Last active
January 17, 2016 12:44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ); | |
} |