Skip to content

Instantly share code, notes, and snippets.

View chancecorbeil's full-sized avatar
🐢
Turtle Stuff

Chance Corbeil chancecorbeil

🐢
Turtle Stuff
View GitHub Profile
@lesliedoherty
lesliedoherty / wcag2_1.csv
Last active June 24, 2024 13:15
WCAG 2.1 Guidelines in CSV
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
Error,summary,sufficient techniques situation A,sufficient techniques situation B,sufficient techniques situation C,sufficient techniques situation D,sufficient techniques situation E,sufficient techniques situation F,Failures,Advisory Techniques
1.1.1 Non-text ContentLevel A,"All non-text content that is presented to the user has a text alternative that serves the equivalent purpose, except for the situations listed below. Show Hide full descriptionControls, Input: If non-text content is a control or accepts user input, then it has a name that describes its purpose. (Refer to Success Criterion 4.1.2 for additional requirements for controls and content that accepts user input.)Time-Based Media: If non-text content is time-based media, then text alternatives at least provide descriptive identification of the non-text content. (Refer to Guideline 1.2 for additional requirements for media.)Test: If non-text content is a test or exercise that would be invalid if presented in text, then text alternatives at least
@brickbones
brickbones / wordpress-page-temaplate.php
Created April 20, 2019 18:07
WordPress page template with API (javascript and php)
<?php /* Template Name: Awesome Page */
get_header();
?>
<div class="latest-posts"></div>
<script>
<?php
/**
* Add a block category for "Get With Gutenberg" if it doesn't exist already.
*
* @param array $categories Array of block categories.
*
* @return array
*/
function gwg_block_categories( $categories ) {
$category_slugs = wp_list_pluck( $categories, 'slug' );
@sanoop-jose
sanoop-jose / sass-theme.scss
Created June 14, 2018 19:32
SASS Theme example theme file
$themes: (
light: (
backgroundLight: #fff,
backgroundDark: #f7f7f8,
textColor: #fff,
textDark: #000,
textLight: #919394,
contentColor: #b9baba,
iconColor: #000,
@paulfarino
paulfarino / sass-theme.scss
Created October 21, 2016 22:02
Sass Theming
// Variables
$black : #000000;
$white : #FFFFFF;
$alpha : #FF0000;
$themes: (
blue: (
alpha: blue,
beta: orange
),
@jpcontrerasv
jpcontrerasv / ACF If Else field.php
Created August 26, 2016 04:46
ACF If Else field
<?php if ( get_field( 'field_name' ) ): ?>
This is displayed when the field_name is TRUE or has a value.
<?php else: // field_name returned false ?>
This is displayed when the field is FALSE, NULL or the field does not exist.
<?php endif; // end of if field_name logic ?>
@rveitch
rveitch / sass-7-1-pattern.scss
Last active June 24, 2024 12:21
Sass 7-1 Pattern
sass/
|
|– base/
| |– _reset.scss # Reset/normalize
| |– _typography.scss # Typography rules
| ... # Etc…
|
|– components/
| |– _buttons.scss # Buttons
| |– _carousel.scss # Carousel
@chancecorbeil
chancecorbeil / Alternate title tags in WordPress
Created June 27, 2015 23:48
Alternating h1 and h2 title tags, depending if page is home page or not
<?php if(is_front_page()) : ?>
<!-- This is a homepage -->
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<?php endif; ?>
<?php if(!is_front_page()) : ?>
<!-- This is not a homepage -->
<h2 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h2>
<?php endif; ?>
@intelliweb
intelliweb / is_tree.php
Last active March 1, 2021 20:57
WP: is_tree() function to check if the current page is the page or a sub page of the page ID specified. Can be used as conditional tag with Widget Logic. Source: http://codex.wordpress.org/Conditional_Tags#A_PAGE_Page
<?php
// This function will return true if we are looking at the page in question or one of its sub pages
function is_tree( $pid ) { // $pid = The ID of the page we're looking for pages underneath
global $post; // load details about this page
if ( is_page($pid) )
return TRUE; // we're at the page or at a sub page
$anc = get_post_ancestors( $post->ID );
@jameskoster
jameskoster / functions.php
Last active November 22, 2022 13:34
WooCommerce - Rename product data tabs
add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
function woo_rename_tabs( $tabs ) {
$tabs['description']['title'] = __( 'More Information' ); // Rename the description tab
$tabs['reviews']['title'] = __( 'Ratings' ); // Rename the reviews tab
$tabs['additional_information']['title'] = __( 'Product Data' ); // Rename the additional information tab
return $tabs;
}