Skip to content

Instantly share code, notes, and snippets.

@jonwatson87
jonwatson87 / functions.php
Last active July 8, 2016 13:26
Relabel author names from Login to Last Name, First Name when displaying Co-Authors Pro as a taxonomy in Search & Filter Pro Raw, and sort by the new label
// Relabel Co-Authors in Search & Filter
function filter_function_name($input_object, $sfid) {
if ($input_object['name'] == '_sft_author') {
global $coauthors_plus;
// Update option labels before rendering
@jonwatson87
jonwatson87 / template.php
Created June 20, 2016 23:32
Replace default genesis loop with custom content/layout
// Replace default genesis loop
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'your_custom_loop' );
function your_custom_loop() {
// Custom Content Here
}
@jonwatson87
jonwatson87 / template.php
Created June 20, 2016 23:27
Replace genesis default sidebar with custom sidebar on a specific template
// Replace standard sidebar with custom sidebar
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
remove_action( 'genesis_sidebar_alt', 'genesis_do_sidebar_alt' );
add_action( 'genesis_sidebar', 'your_custom_sidebar' );
function your_custom_sidebar() {
echo '<div class="custom-sidebar">';
@jonwatson87
jonwatson87 / bb-custom.js
Created June 20, 2016 23:23
Recalculate equal height columns for Beaver Builder Accordion (in conjunction with the Equal Height Columns plugin) - useful for equal height post sidebars containing accordion/other expanding elements
jQuery( function() {
jQuery( '.fl-accordion-button' ).on( 'click', function() {
setTimeout( function() {
jQuery( window ).trigger( 'equalheights' );
}, 500);
} );
} );
@jonwatson87
jonwatson87 / functions.php
Created June 20, 2016 23:20
Genesis Custom Sidebars
// Register Custom Sidebars/Widget Areas
genesis_register_sidebar( array(
'id' => 'your-sidebar-id',
'name' => __( 'Your Sidebar Name' ),
'description' => __( 'Your Sidebar Description' ),
) );
@jonwatson87
jonwatson87 / functions.php
Created June 20, 2016 23:18
Genesis Custom Footer
// Custom Footer
remove_action( 'genesis_footer', 'genesis_do_footer' );
add_action( 'genesis_footer', 'your_custom_footer' );
function your_custom_footer() {
echo '<p>';
echo '&copy; Copyright ';
echo '<a href="http://yourdomain.com">Your Domain Name </a>';
@jonwatson87
jonwatson87 / functions.php
Last active July 8, 2016 13:16
Relabel author names from Login to Display Name when displaying Co-Authors Pro as a taxonomy in Search & Filter Pro
// Replace Co-Author labels in Search & Filter Pro (default name = login/default value=slug) with display_name
function filter_function_name($input_object, $sfid) {
if ($input_object['name'] == '_sft_author') {
global $coauthors_plus;
//udpate this field before rendering