Skip to content

Instantly share code, notes, and snippets.

View mrwweb's full-sized avatar

Mark Root-Wiley mrwweb

View GitHub Profile
@markjaquith
markjaquith / gist:4487609
Created January 8, 2013 20:25
WordPress ASCII art.
<!--
`-/+osssssssssssso+/-`
./oys+:.` `.:+syo/.
.+ys:. .:/osyyhhhhyyso/:. ./sy+.
/ys: -+ydmmmmmmmmmmmmmmmmmmdy+- :sy/
/h+` -odmmmmmmmmmmmmmmmmmmmmmmmmmmdo- `+h/
:ho` /hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmds/ `oh:
`sy. /hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmd+ .ys`
.ho `sdddhhhyhmmmdyyhhhdddddhhhyydmmmmy oh.
@jdelia
jdelia / code-functions.php
Last active August 2, 2018 16:57
SVG Icons and Graphic Elements
// Add the SVG icons functions.
include_once( get_stylesheet_directory() . '/lib/icon-functions.php' );
@pestbarn
pestbarn / IE11-grid-with-autoprefixer.md
Last active January 23, 2019 18:56
CSS Grid for IE11 using Autoprefixer

About: CSS Grid for IE11

CSS Grid in IE11 is an implementation based on the 2011 spec, which means we aren't really able to use grids out of the box according to the newer spec. However, Autoprefixer automates a lot of work for us with getting the correct IE11 properties, and it has support for most (if not all?) -ms-grid properties.

There are still some gotchas which Autoprefixer can't help with though:

  • There is no auto-placement behaviour in the 2011 spec. This means that for IE11, you have to position everything. rather than use the autoplacement ability of grid.
  • Using minmax() with an auto value is not supported, and will break things - e.g. minmax(auto, 1200px) will not work. To use minmax, you have to specify two positive values - e.g. minmax(500px, 1200px).
  • grid-gap properties were added in a later spec. To create grid-gaps in IE11, you will need to create separate
@thefuxia
thefuxia / t5-fresh-editor-stylesheets.php
Created July 21, 2012 06:46
T5 Fresh Editor Stylesheets
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: T5 Fresh Editor Stylesheets
* Description: Enforces fresh editor stylesheets per version parameter.
* Version: 2012.08.09
* Author: Thomas Scholz
* Plugin URI: http://toscho.de/?p=1965
* Author URI: http://toscho.de
* License: MIT
* License URI: http://www.opensource.org/licenses/mit-license.php
@trepmal
trepmal / toggle-debug.php
Last active September 4, 2020 15:42
WordPress experiment. Toggle debug from admin bar
<?php
/*
Plugin Name: Toggle Debug
Description: Proof-of-concept for an admin-bar debug mode toggle. Needs some UX love.
*/
/*
// In wp-config.php, wrap debug constants in a cookie conditional
if ( isset( $_COOKIE['wp-debug'] ) && $_COOKIE['wp-debug'] == 'on' ) {
define('WP_DEBUG', true);
}
@djrmom
djrmom / custom-hooks.php
Created April 17, 2020 14:57
facetwp archive query main query
<?php
/** make sure facet always targets the archive query as the main query
** sometimes there is a mysterious extra query that is a duplicate
** of the main query
**/
add_filter( 'pre_get_posts', function( $query ) {
if ( $query->is_archive() && $query->is_main_query() ) {
$query->set( 'facetwp', true );
}
}, 9 );
@mrwweb
mrwweb / nested-block-alignments.css
Created January 6, 2021 01:18
WordPress Block Alignment Classes with Support for Nested Group Blocks
.block-container > *, /* [1] */
.wp-block-group__inner-container > * { /* [2] */
max-width: 46.25rem;
margin-left: 1.25rem;
margin-right: 1.25rem;
@media (min-width: 48.75em) { /* [3] */
margin-left: auto;
margin-right: auto;
}
@mrwweb
mrwweb / faux-block-editor.css
Last active February 10, 2022 17:13
CSS to make the Classic Editor look more like the Block Editor
/**
* faux-block-editor.css v1.1
*
* Styles to make the Classic Editor screen appear more like the Block Editor
*
* Expects the class "faux-block-editor" on any screen that should use these styles
*/
.faux-block-editor {
overflow-x: hidden;
@afragen
afragen / tribe-ical-outlook-modify.php
Last active June 8, 2022 21:07
Modify Event Calendar iCal feed properties for Outlook
<?php
//Add the following to your theme's functions.php
add_filter( 'tribe_ical_properties', 'tribe_ical_outlook_modify', 10, 2 );
function tribe_ical_outlook_modify( $content ) {
$properties = preg_split ( '/$\R?^/m', $content );
$searchValue = "X-WR-CALNAME";
$fl_array = preg_grep('/^' . "$searchValue" . '.*/', $properties);
$key = array_values($fl_array);
$keynum = key($fl_array);
@ryanwelcher
ryanwelcher / theme.json
Created February 8, 2022 17:30
When adding theme.json to an existing Classic Theme, these settings will stop the default color and typography controls from being enabled.
{
"$schema": "http://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {
"layout": {
"contentSize": "750px"
},
"color": {
"background": false,
"custom": false,