Skip to content

Instantly share code, notes, and snippets.

@anschaef
anschaef / bootstrap-4-sass-mixins-cheat-sheet.scss
Last active April 12, 2024 08:49
Bootstrap 4 Sass Mixins [Cheat sheet with examples]
/* -------------------------------------------------------------------------- */
// All Bootstrap 4 Sass Mixins [Cheat sheet]
// Updated to Bootstrap v4.5.x
// @author https://anschaef.de
// @see https://github.com/twbs/bootstrap/tree/master/scss/mixins
/* -------------------------------------------------------------------------- */
/*
// ########################################################################## */
// New cheat sheet for Bootstrap 5:
@vwasteels
vwasteels / getMenuHierarchically.md
Last active June 28, 2022 13:12
Retrieve menu items hierarchically in Wordpress
/**
 * Get Menu Items From Location
 *
 * @param $location : location slug given as key in register_nav_menus
 */

function getMenuItemsFromLocation($location) {
	$theme_locations = get_nav_menu_locations();
@davechu
davechu / Add Class to Genesis Primary Sidebar
Created October 24, 2014 15:40
For Ben, this goes in functions.php or the equivalent. In this world of HTML5, sometimes it's handy to put in classes, ID's, etc. To see the list of goodies, read /genesis/lib/functions/markup.php.
add_filter( 'genesis_attr_sidebar-primary', 'dc_ben_sidebar_attr' );
function dc_ben_sidebar_attr( $attributes ) {
$attributes['class'] .= ' col3';
return $attributes;
}
@anthonyholmes
anthonyholmes / bootstrap-sass-mixin-cheatsheet.scss
Created October 10, 2014 08:13
Bootstrap Sass Mixin Cheatsheet
// Alerts
@include alert-variant($background, $border, $text-color);
// Background Variant
@include bg-variant($parent, $color);
// Border Radius
@include border-top-radius($radius);
@include border-right-radius($radius);
@include border-bottom-radius($radius);
<?php
/**
* Blog Intro
*
*/
function be_blog_intro() {
$content = get_post( get_option( 'page_for_posts' ) )->post_content;
if( $content )
echo '<div class="blog-intro">' . wpautop( $content ) . '</div>';
@forgeandsmith
forgeandsmith / Gravity Forms Reset Styles
Last active June 22, 2021 07:33
Gravity Forms SCSS reset styles for easy style editing and management
///////////////////////////////////////////////
////// GRAVITY FORMS RESET STYLES //////
///////////////////////////////////////////////
// These styles are made in mind to be used with SCSS or LESS
// If you use these styles, you must go to the Gravity Forms settings in the WordPress back end and set Output CSS to No.
////----- Core Containers
.gform_heading,
.gform_body,
@jg314
jg314 / gravity_forms_ga_tracking.php
Last active November 30, 2017 20:20
Add Google Analytics Ecommerce tracking to a donation form created through Gravity Forms.
<?php
/*
* Add custom query vars to handle Google Analytics Ecommerce tracking.
* This should be placed in a plugin or in functions.php of the theme.
*
* You'll want to use the redirect method for Gravity Forms confirmations and
* turn on passing field data via a query string. An example we used was:
* donation_amount={Donation Amount:13}&donation_id={entry_id}&donation_recurring=0
*/
function sm_add_query_vars( $vars ){