Skip to content

Instantly share code, notes, and snippets.

Damien Carbery damiencarbery

Block or report user

Report or block damiencarbery

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@damiencarbery
damiencarbery / woocommerce-stock-info.php
Created Oct 13, 2019
List stock levels in WooCommerce - List the stock level for each product and variation. https://www.damiencarbery.com/2019/10/list-stock-levels-in-woocommerce/
View woocommerce-stock-info.php
<?php
/*
Plugin Name: WooCommerce Stock Info
Plugin URI: https://www.damiencarbery.com/2019/10/list-stock-levels-in-woocommerce/
Description: List the stock level for each product and variation.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.1
*/
@damiencarbery
damiencarbery / disable-cf7.php
Last active Oct 7, 2019
Disable Contact Form 7 plugin except for certain pages.
View disable-cf7.php
<?php
/*
Plugin Name: Disable CF7 plugin
Plugin URI: http://www.damiencarbery.com
Description: Disable Contact Form 7 plugin except for certain pages.
Author: Damien Carbery
Version: $Revision: $
$Id: $
*/
@damiencarbery
damiencarbery / index.php
Last active Oct 7, 2019
Understanding the WordPress template hierarchy - Use the template hierarchy to change the presentation of a specific page or a bunch of them or all of them. It's your choice! https://www.damiencarbery.com/2019/10/understanding-the-wordpress-template-hierarchy/
View index.php
<?php
wp_head();
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
the_title();
the_content();
}
}
@damiencarbery
damiencarbery / wc-price-superscript-first-pass.php
Last active Oct 5, 2019
Superscript WooCommerce price decimals - Superscript the decimals of a WooCommerce price. And then rewrite the code to make it better. https://www.damiencarbery.com/2018/10/superscript-woocommerce-price-decimals/
View wc-price-superscript-first-pass.php
<?php
/*
Plugin Name: Superscript WooCommerce price decimals
Plugin URI: https://www.damiencarbery.com/2018/10/superscript-woocommerce-price-decimals/
Description: Quick experiment with making decimal portion of price superscript.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.1
*/
@damiencarbery
damiencarbery / blog-page-two-flexbox-cols.php
Last active Oct 5, 2019
From Genesis WordPress Facebook group - blog page in two columns
View blog-page-two-flexbox-cols.php
<?php
// Copy to theme directory as home.php
// Display content archive in two columns using flexbox.
// By Damien Carbery, https://www.damiencarbery.com
// 29 September 2019
add_action( 'wp_head', 'dcwd_flex_css' );
function dcwd_flex_css() {
?>
@damiencarbery
damiencarbery / notify-admin-of-address-change.php
Created Sep 30, 2019
Notify admin of customer address changes - Email the site admin when a customer changes their billing or shipping address in WooCommerce. https://www.damiencarbery.com/2019/09/notify-admin-of-customer-address-changes/
View notify-admin-of-address-change.php
<?php
/*
Plugin Name: Notify admin of customer address changes
Plugin URI: https://www.damiencarbery.com/2019/09/notify-admin-of-customer-address-changes/
Description: Email the site admin when a customer changes their billing or shipping address in WooCommerce.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.1
*/
View add-structural-wraps-genesis.php
<?php
add_filter( ‘genesis_structural_wrap-header’, ‘do_full_width_page_header, 10, 2 );
function do_full_width_page_header( $output, $original_output ) {
return sprintf( '<div class="full-width-page-header" style="background: url(\'%s\');"></div>',
wp_get_attachment_image_url( 2623, ‘full’ )
) . $output;
}
@damiencarbery
damiencarbery / inject-ad-content.php
Last active Sep 23, 2019
Inject Adverts into Posts and Pages - Inject a specified page or widget area into post or page content. https://www.damiencarbery.com/2019/09/inject-adverts-into-posts-and-pages/
View inject-ad-content.php
<?php
/*
Plugin Name: Inject Adverts into Posts and Pages
Plugin URI: https://www.damiencarbery.com/2019/09/inject-adverts-into-posts-and-pages/
Description: Inject a specified page or widget area into post or page content.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.1
*/
@damiencarbery
damiencarbery / conditional-wc-email-sending.php
Created Dec 29, 2018
Conditionally send WooCommerce emails: Dynamically determine whether to send a WooCommerce email. https://www.damiencarbery.com/2018/12/conditionally-disable-woocommerce-emails/
View conditional-wc-email-sending.php
<?php
/*
Plugin Name: Conditionally send WooCommerce emails
Plugin URI: https://www.damiencarbery.com/2018/12/conditionally-disable-woocommerce-emails/
Description: Dynamically determine whether to send a WooCommerce email.
Author: Damien Carbery
Version: 0.1
*/
// The filter name is 'woocommerce_email_enabled_'.WC_Email::id e.g. 'new_order', 'cancelled_order' etc
@damiencarbery
damiencarbery / wayback-availability.php
Created Sep 15, 2019
Find Wayback Machine snapshots easily - Use the Wayback Machine API to quickly find the most recent snapshot for a url. https://www.damiencarbery.com/2019/09/find-wayback-machine-snapshots-easily/
View wayback-availability.php
<!DOCTYPE html>
<!--
Find Wayback Machine snapshots easily
Use the Wayback Machine API to quickly find the most recent snapshot for a url.
https://www.damiencarbery.com/2019/09/find-wayback-machine-snapshots-easily/
-->
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<title>Wayback Availability</title>
You can’t perform that action at this time.