Skip to content

Instantly share code, notes, and snippets.

View alexmustin's full-sized avatar

Alex Mustin alexmustin

View GitHub Profile
@alexmustin
alexmustin / functions.php
Last active August 18, 2022 23:00
Custom Genesis Pagination functions and styles
<?php
// CUSTOM LABEL: PREVIOUS BUTTON.
add_filter( 'genesis_prev_link_text', 'modify_previous_link_text' );
function modify_previous_link_text($text) {
$text = '< PREV';
return $text;
}
// CUSTOM LABEL: NEXT BUTTON.
@alexmustin
alexmustin / readme.md
Last active June 19, 2022 07:09
ConvertKit - How to create a Visual Automation for a Giveaway

ConvertKit Giveaway Automation

The following is an example of how to incorporate a ConvertKit Automation for a Giveaway.

This example assumes you have setup a Form on ConvertKit (called 'Giveaway Form').

1. Setup the Visual Automation

The following is a rough diagram of a sample Visual Automation. An explanation is provided after the diagram.

      [WEBSITE FORM]
@alexmustin
alexmustin / block-style-variations.js
Created August 5, 2020 19:08
WP - Add block style variations
jQuery(document).ready(function($) {
// Add 'Semibold' style to Paragraph blocks
wp.blocks.registerBlockStyle("core/paragraph", {
name: "semibold",
label: "Semibold"
});
// Add 'Black' style to Paragraph blocks
wp.blocks.registerBlockStyle("core/paragraph", {
@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 April 5, 2022 05:48
WordPress: Enable the Block-based Widget Editor
<?php
//* Enable the block-based widget editor
add_filter( 'use_widgets_block_editor', '__return_true' );
@alexmustin
alexmustin / shortcode.php
Created December 2, 2021 21:20
A shortcode to display the latest release number for a provided GitHub repository
<?php
/**
* Displays the latest release number from a provided GitHub repository.
*
* Example usage: [show_repo_version_number repo="alexmustin/woo-custom-emails-per-product"]
*
* @param array $atts An array of shortcode attributes.
* @return string $output A string of text including the release number.
*/
function show_repo_version_number_function( $atts ) {
@alexmustin
alexmustin / _grid.scss
Last active November 11, 2021 06:33
CSS Grid - responsive 3-column grid example
.products-wrap {
display: grid;
justify-content: space-between;
grid-template-columns: repeat(auto-fill, 100%);
@include media( $screen--m ) {
grid-template-columns: repeat(auto-fill, 48%);
grid-gap: 2%;
}
@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 / 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' );