Skip to content

Instantly share code, notes, and snippets.

View alexgordon25's full-sized avatar

Daniel Gordon alexgordon25

View GitHub Profile
@alexgordon25
alexgordon25 / WordPress Theme Customizer Sample.php
Created May 25, 2020 08:30
WordPress Theme Customizer Sample
<?php
function wp_soupee_customizer_register( $wp_customize ){
$wp_customize->add_section( 'theme_options', array(
'title' => __( 'Theme Options', 'wp-soupee' ),
'priority' => 80,
) );
// =============================
// = Text Input =
@alexgordon25
alexgordon25 / query_args.php
Created May 8, 2019 03:48
WordPress WP_Query, 'orderby' with multiple 'meta_key's
$query_args['meta_query'] = array(
$meta_query = array(
'relation' => 'AND',
'custom_date_query' => array(
'key' => 'custom_date',
'type' => 'DATETIME',
'orderby' => 'meta_value_num',
),
'custom_time_query' => array(
'key' => 'custom_time',
@alexgordon25
alexgordon25 / SCSS.md
Created February 24, 2019 00:25 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

โ‡ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@alexgordon25
alexgordon25 / function.php
Created February 19, 2019 03:49
Set Advanced Custom Fields metabox priority.
/**
* Set Advanced Custom Fields metabox priority.
*
* @param string $priority The metabox priority.
* @param array $field_group The field group data.
* @return string $priority The metabox priority, modified.
*/
function set_acf_metabox_priority( $priority, $field_group ) {
if ( 'group_5c6b4b7c724b6' === $field_group['key'] || 'group_5c6b39ea19d7c' === $field_group['key'] ) {