Skip to content

Instantly share code, notes, and snippets.

View alexmustin's full-sized avatar

Alex Mustin alexmustin

View GitHub Profile
@alexmustin
alexmustin / style.css
Last active February 10, 2023 02:47
Responsive / Fluid Typography -- CSS clamp() example
/*
* This will keep the element's font size between 24px and 42px.
* The middle value automatically calculates the font size between
* the Min and Max, using the browser window viewport width.
*/
.archive-title {
font-size: clamp(24px, calc(3vw + 1rem), 42px);
}
@alexmustin
alexmustin / functions.php
Last active November 1, 2021 21:57
WooCommerce - disable 'Order Complete' emails for specific Product ID
<?php
add_filter( 'woocommerce_email_recipient_customer_completed_order', 'themename_disable_customer_order_email_for_product', 10, 2 );
function themename_disable_customer_order_email_for_product( $recipient, $order ) {
// Get the current page.
$page = $_GET['page'] = isset( $_GET['page'] ) ? $_GET['page'] : '';
// If we're on a WooCommerce settings page, return the regular recipient.
if ( 'wc-settings' === $page ) {
return $recipient;
}
@alexmustin
alexmustin / WooCommerce-MyAccount-menu-with-FontAwesome-icons.png
Last active April 6, 2022 01:31
WooCommerce - Account Page Sidebar Nav Menu styles with FontAwesome icons
WooCommerce-MyAccount-menu-with-FontAwesome-icons.png
@alexmustin
alexmustin / functions.php
Created November 25, 2020 04:37
WordPress - Add page slug to body class
<?php
// Add page slug to Body class.
function add_slug_body_class( $classes ) {
global $post;
if ( isset( $post ) ) {
$classes[] = $post->post_type . '-' . $post->post_name;
}
return $classes;
}
@alexmustin
alexmustin / load-scripts.php
Created October 16, 2020 00:00
Course Maker Pro - /lib/load-scripts.php
<?php
/**
* Loads scripts and stylesheets for the Course Maker Pro theme.
*
* @since 1.0
*
* @package Course Maker Pro
*/
add_action( 'wp_enqueue_scripts', 'course_maker_enqueue_scripts_styles' );
@alexmustin
alexmustin / appearance.php
Created October 15, 2020 23:23
Course Maker Pro - /config/appearance.php
<?php
/**
* Course Maker Pro appearance settings
*
* @package Course Maker Pro
* @author brandiD
* @license GPL-2.0-or-later
*/
$course_maker_default_colors = array(
@alexmustin
alexmustin / responsive-menus.php
Created October 15, 2020 23:18
Course Maker Pro - /config/responsive-menus.php
<?php
/**
* Course Maker - Responsive Menu features
*
* @package Course Maker Pro
* @author StudioPress
* @license GPL-2.0-or-later
* @link https://my.studiopress.com/themes/genesis-sample/
*/
@alexmustin
alexmustin / child-theme-settings.php
Created October 15, 2020 23:07
Course Maker Pro - /config/child-theme-settings.php
<?php
/**
* Course Maker Pro Theme settings.
*
* Genesis 2.9+ updates these settings when themes are activated.
*
* @package Course Maker Pro
*/
return array(
@alexmustin
alexmustin / theme-supports.php
Last active October 15, 2020 23:01
Course Maker Pro - /config/theme-supports.php
<?php
/**
* Course Maker Pro - Theme supports declarations.
*
* @package Course Maker Pro
* @author StudioPress
* @license GPL-2.0-or-later
* @link https://my.studiopress.com/themes/genesis-sample/
*/
@alexmustin
alexmustin / 01-original-script.js
Last active October 12, 2020 21:30
JavaScript - Uncaught Error: Syntax error, unrecognized expression: a[href*=#]:not([href=#])
(function ($) {
$( 'div[class^="front-page-"] a[href*=#]:not([href=#])' ).click( function() {
// More code here...
});
})(jQuery);