Skip to content

Instantly share code, notes, and snippets.

View richstrauss's full-sized avatar

Rich Strauss richstrauss

View GitHub Profile
@stompweb
stompweb / yoast_breadcrumbs_learndash.php
Created March 4, 2017 10:03
Yoast breadcrumbs for LearnDash
<?php
function stomp_filter_learndash_yoast_breadcrumbs( $links ) {
$course_label = 'Courses';
$labels = get_option( 'learndash_custom_label_settings' );
if ( ! empty( $labels['courses'] ) ) {
$course_label = sanitize_text_field( $labels['courses'] );
}
if ( is_singular( 'sfwd-lessons' ) ) {
@spivurno
spivurno / gw-gravity-forms-horizontal-forms.css
Last active June 4, 2019 19:03
Gravity Wiz // Gravity Forms // Horizontal Form Helper Styles
.gf_simple_horizontal_wrapper.gf_browser_chrome ul.gform_fields li.gfield span.name_first,
.gf_simple_horizontal_wrapper.gf_browser_chrome ul.gform_fields li.gfield span.name_middle,
.gf_simple_horizontal_wrapper.gf_browser_chrome ul.gform_fields li.gfield span.name_last {
padding-top: 0 !important;
}
.gf_simple_horizontal_wrapper .field_sublabel_hidden_label .ginput_complex.ginput_container input[type=text],
.gf_simple_horizontal_wrapper .field_sublabel_hidden_label .ginput_complex.ginput_container select {
margin-bottom: 0 !important;
}
@contemplate
contemplate / functions.php
Last active November 14, 2023 12:59
WooCommerce - Allow guest checkout for certain products when Guest checkout is Disabled globally
/*--------------------------------------
Woocommerce - Allow Guest Checkout on Certain products
----------------------------------------*/
// Display Guest Checkout Field
add_action( 'woocommerce_product_options_general_product_data', 'woo_add_custom_general_fields' );
function woo_add_custom_general_fields() {
global $woocommerce, $post;
echo '<div class="options_group">';
@mikejolley
mikejolley / functions.php
Created March 10, 2016 09:39
WooCommerce Disable guest checkout for certain products
<?php
// Code goes in theme functions.php or a custom plugin
add_filter( 'pre_option_woocommerce_enable_guest_checkout', 'conditional_guest_checkout_based_on_product' );
function conditional_guest_checkout_based_on_product( $value ) {
$restrict_ids = array( 1, 2, 3 ); // Replace with product ids which cannot use guest checkout
if ( WC()->cart ) {
$cart = WC()->cart->get_cart();
@hirejordansmith
hirejordansmith / enable-gf-field-label-visibility-settings.php
Created February 10, 2016 11:24
Enable GF field label visibility settings
<?php
add_filter( 'gform_enable_field_label_visibility_settings', '__return_true' );
?>
@neilgee
neilgee / agencypro.php
Last active January 26, 2017 23:44
Agency Pro - Multiple background Images
<?php
//* Enqueue Backstretch script and prepare images for loading
add_action( 'wp_enqueue_scripts', 'agency_enqueue_backstretch_scripts' );
function agency_enqueue_backstretch_scripts() {
// $image = get_option( 'agency-backstretch-image', sprintf( '%s/images/bg.jpg', get_stylesheet_directory_uri() ) );
//* Load scripts only if custom backstretch image is being used
//if ( ! empty( $image ) ) {
@AlphaBlossom
AlphaBlossom / remove-woocommerce-admin-theme-support-warning.php
Last active February 7, 2022 15:35
Integrate WooCommerce into Genesis Child Theme
// Remove WooCommerce Theme Support admin message
add_theme_support( 'woocommerce' );
@frankyonnetti
frankyonnetti / CSS--hex-opacity-values.css
Last active December 8, 2023 05:56
#css Hex Opacity Values
/*
* Hex Opacity Values
*/
100% — FF
95% — F2
90% — E6
85% — D9
80% — CC
75% — BF
@cobaltapps
cobaltapps / DWB Responsive Logo Image Trick
Last active August 28, 2019 01:10
This CSS code is for a DWB screencast where I show how to make your Logo Image responsive, without the need for multiple images.
/* 5th @media query trigger point */
.site-header {
min-height: 80px;
}
.header-image .site-header .wrap .title-area {
width: 320px;
height: 80px;
background-size: 320px 80px;
}
add_action('genesis_meta', 'remove_category_menu_exclude_archives_posts');
function remove_category_menu_exclude_archives_posts() {
if ( !is_archive() && !is_single() && !is_page('blog') )
remove_action('genesis_after_header', 'genesis_do_subnav');
}