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 | |
//* Add this to your functions.php file. Do NOT include the opening php tag | |
// Ensure cart contents update when products are added to the cart via AJAX | |
add_filter( 'woocommerce_add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment' ); | |
function woocommerce_header_add_to_cart_fragment( $fragments ) { | |
ob_start(); | |
?> |
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 | |
//* Add this to your functions.php file. Do NOT include the opening php tag | |
//* Add the "Formats" drop-down in the WP editor | |
add_filter( 'mce_buttons_2', 'ab_mce_editor_buttons' ); | |
function ab_mce_editor_buttons( $buttons ) { | |
array_unshift( $buttons, 'styleselect' ); | |
return $buttons; | |
} |
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 | |
//* Add this to your functions.php file. Do NOT include the opening php tag | |
//* Add After Footer area | |
add_action( 'genesis_after_footer', 'include_after_footer' ); | |
function include_after_footer() { | |
require(CHILD_DIR.'/after-footer.php'); | |
} |
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 | |
//* Add this to your functions.php file. Do NOT include the opening php tag | |
//* Add Before Sidebar widget area | |
genesis_register_sidebar( array( | |
'id' => 'before-sidebar', | |
'name' => __( 'Before Sidebar', 'themename' ), | |
'description' => __( 'This is a widget area that can be placed above the sidebar', 'themename' ), | |
) ); |
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 | |
//* Add this to your functions.php file. Do NOT include the opening php tag | |
//* Add Dashicon to search form button | |
add_filter( 'genesis_search_button_text', 'ab_search_button_icon' ); | |
function ab_search_button_icon( $text ) { | |
return esc_attr( '' ); | |
} |
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 | |
//* Add this to your functions.php file. Do NOT include the opening php tag | |
//* Allow Standard WordPress Text widget to execute PHP | |
function php_execute($html){ | |
if(strpos($html,"<"."?php")!==false){ ob_start(); eval("?".">".$html); | |
$html=ob_get_contents(); | |
ob_end_clean(); | |
} | |
return $html; |
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 | |
//* Add this to your functions.php file. Do NOT include the opening php tag | |
//* Add a Before Footer widget area | |
genesis_register_sidebar( array( | |
'id' => 'before-footer', | |
'name' => __( 'Before Footer' ), | |
'description' => __( 'This is the area just above the footer', 'genesis' ), | |
) ); |
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 | |
//* Add this to your functions.php file. Do NOT include the opening php tag | |
//* Change the footer content | |
add_filter('genesis_footer_creds_text', 'ab_footer_creds_filter'); | |
function ab_footer_creds_filter( $creds ) { | |
$creds = '[footer_copyright] <a href="http://www.example.com">Your Name</a>'; | |
return $creds; | |
} |
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 | |
//* Add this to your functions.php file. Do NOT include the opening php tag | |
// Display Custom Post Type in Author Archive | |
function post_types_author_archives($query) { | |
if ($query->is_author) | |
// Allow 'my_custom_post_type' CPT and the default 'posts' to display in author's archive | |
$query->set( 'post_type', array('my_custom_post_type', 'posts') ); | |
remove_action( 'pre_get_posts', 'custom_post_author_archive' ); | |
} |
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 | |
//* Add this to your functions.php file. Do NOT include the opening php tag | |
//* Reposition the primary navigation menu | |
remove_action( 'genesis_after_header', 'genesis_do_nav' ); | |
add_action( 'genesis_header', 'genesis_do_nav', 12 ); |
OlderNewer