Skip to content

Instantly share code, notes, and snippets.

<?php
// Remove the date and time on comments in Genesis child themes
add_filter( 'genesis_show_comment_date', '__return_false' );
<?php
/**
* Allows developer to control whether to print the comment date.
*
* @since 2.2.0
*
* @param boolean $comment_date Whether to print the comment date
* @param string $post_type The current post type
*/
<?php
add_filter( 'genesis_show_comment_date', 'jmw_show_comment_date_with_link' );
/**
* Show Comment Date with link but without the time
*
* Stop the output of the Genesis core comment dates and outputs comments with date and link only.
* The genesis_show_comment_date filter was introduced in Genesis 2.2 (will not work with older versions)
*
* @author Jo Waltham
@calliaweb
calliaweb / Add Custom Taxonomies to Post Meta
Created November 27, 2013 14:25
Modify Post Meta to add custom taxonomies Author Jo Waltham jo@calliaweb.co.uk Add function to your functions.php
/** Modify Post Meta to add custom taxs
* Author Jo Waltham jo@calliaweb.co.uk
* Add function to your functions.php
*/
add_filter( 'genesis_post_meta', 'jmw_post_meta_filter' );
function jmw_post_meta_filter($post_meta) {
if ( !is_single() ) // Only runs on single posts - remove if you want the output on archive pages
return;
@calliaweb
calliaweb / genesis-site-description-line-break.php
Created April 2, 2016 12:50
Add line break to site description at "--" in Genesis child themes
<?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
<?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
@calliaweb
calliaweb / filter-genesis-structural-wrap.php
Last active September 15, 2016 05:51
Filter Genesis Structural Wrap
<?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'
*/
@calliaweb
calliaweb / cambridge-food-collective-order-export.php
Last active October 4, 2016 11:20
Export Woo & WC Vendors orders including commission rate and amount
<?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
*/
@calliaweb
calliaweb / functions.php
Created October 9, 2016 18:20 — forked from kloon/functions.php
WooCommerce 2.1 Add confirm password option at checkout
<?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,