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 above | |
add_filter('tiny_mce_before_init', 'tiny_mce_remove_unused_formats' ); | |
/* | |
* Modify TinyMCE editor to remove H1. | |
*/ | |
function tiny_mce_remove_unused_formats($init) { | |
// Add block format elements you want to show in dropdown | |
$init['block_formats'] = 'Paragraph=p;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Address=address;Pre=pre'; |
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 above | |
add_action( 'genesis_entry_content', 'jmw_add_envira_gallery_after_content', 15 ); | |
/* | |
* Add the gallery after the end of the content | |
*/ | |
function jmw_add_envira_gallery_after_content() { | |
$gallery = get_post_meta( get_the_ID(), 'gallery' ); // 'gallery' is name of my ACF gallery field |
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_action( 'bp_setup_nav', 'jmw_make_edit_default_for_own_bp_profile', 15 ); | |
/* | |
* Edit the buddypress menus | |
*/ | |
function jmw_make_edit_default_for_own_bp_profile() { | |
global $bp; | |
if ( ! bp_is_my_profile() ) { |
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_filter( 'genesis_comment_list_args', 'jmw_disable_genesis_comment_avatar' ); | |
/** | |
* Disable comment avatars in Genesis. | |
* Set comment avatar size to 0 and use the default WordPress comment function instead of the Genesis one. | |
* | |
* @param array $args Comment args | |
* @return array Filtered comment args | |
*/ |
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_action( 'bp_init', 'jmw_remove_buddypress_messages_for_non_ppmpro_members' ); | |
/** | |
* Remove Messages from Navigation and Add Friends, Private Message and Public Message from BuddyPress profiles | |
* if current user or profile viewed does not have a Paid Membership Pro member level | |
*/ | |
function jmw_remove_buddypress_messages_for_non_ppmpro_members() { | |
global $current_user; |
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 | |
// place the following code in your theme's functions.php file | |
// Add a second password field to the checkout page. | |
add_action( 'woocommerce_checkout_init', 'wc_add_confirm_password_checkout', 10, 1 ); | |
function wc_add_confirm_password_checkout( $checkout ) { | |
if ( get_option( 'woocommerce_registration_generate_password' ) == 'no' ) { | |
$checkout->checkout_fields['account']['account_password2'] = array( | |
'type' => 'password', | |
'label' => __( 'Confirm password', 'woocommerce' ), | |
'required' => true, |
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 | |
/* | |
Plugin Name: Cambridge Food Collective Orders Export | |
Plugin URI: http://www.calliaweb.co.uk | |
Description: Adds Cambridge Food Collective orders export functionality | |
Version: 1.0.0 | |
Author: Jo Waltham | |
Author URI: http://www.calliaweb.co.uk | |
*/ |
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 | |
add_filter( "genesis_structural_wrap-footer-widgets", 'jmw_filter_footer_widgets_structural_wrap', 10, 2); | |
/** | |
* Filter the footer-widgets context of the genesis_structural_wrap to add a div before the closing wrap div. | |
* | |
* @param string $output The markup to be returned | |
* @param string $original_output Set to either 'open' or 'close' | |
*/ |
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_filter( 'widget_tag_cloud_args', 'jmw_exclude_tag_from_tag_cloud'); | |
function jmw_exclude_tag_from_tag_cloud( $args ) { | |
$args[ 'exclude' ] = '36'; // ID of the tag. If multiple tags use comma delimited sting '2,5,36' | |
return $args; | |
} | |
/* | |
* Other arguments that can be changed |
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_filter( 'genesis_seo_description', 'jmw_site_description', 10, 3 ); | |
/** | |
* Add line break to site description at "--" in Genesis child themes | |
* @link http://www.jowaltham.com/line-break-site-description-genesis | |
* | |
* @param string $description The html string that is output as the site description | |
* @param string $inside The site description in General Settings | |
* @param string $wrap The html string to wrap around the site description |
NewerOlder