Skip to content

Instantly share code, notes, and snippets.

View dannydickson's full-sized avatar

Danny D. dannydickson

View GitHub Profile
@dannydickson
dannydickson / corporate-pro-genesis-superfish-menu-breakpoint-fix.css
Last active August 23, 2018 16:12
Corporate Pro Genesis Superfish Menu Breakpoint Fix
/* ========================
Hamburger Breakpoint Fix
========================== */
/* First we move the styles from the mobile only
main style.css file to extend up to our new custom
breakpoint in this media query (default breakpoint
of theme was 896) */
@media (min-width: 896px) and (max-width: 1244px) {
@dannydickson
dannydickson / hide-gravity-forms-labels.php
Created June 29, 2019 10:52
Enable: Hide Gravity Forms Labels
// Place in functions.php
// Enables option to hide Gravity Forms labels in WP backend the right way instead of display: none CSS
add_filter( 'gform_enable_field_label_visibility_settings', '__return_true' );
@dannydickson
dannydickson / hide-gravity-forms-labels.php
Created June 29, 2019 10:52
Enable: Hide Gravity Forms Labels
// Place in functions.php
// Enables option to hide Gravity Forms labels in WP backend the right way instead of display: none CSS
add_filter( 'gform_enable_field_label_visibility_settings', '__return_true' );
@dannydickson
dannydickson / material-icons-list-for-dropdown.txt
Created July 11, 2019 23:18
Material Icons List for Dropdown
3d_rotation
ac_unit
access_alarm
access_alarms
access_time
accessibility
accessible
account_balance
account_balance_wallet
account_box
@dannydickson
dannydickson / sort-by-custom-field.php
Last active July 11, 2019 23:32
Sort by custom field in WordPress
<?php
// Taken and modified from https://www.advancedcustomfields.com/resources/orde-posts-by-custom-fields/
// Put here for posterity's sake as a bookmark of sorts
// Allows sorting by custom field value instead of default.
// This will allow client to be able to set the order of these goals/landing pages as they add more.
// Can be added to functions.php, or to custom template that gets called before your custom loop.
function my_pre_get_posts( $query ) {
// do not modify queries in the admin
@dannydickson
dannydickson / dark-theme.css
Last active August 20, 2019 20:03
My Slack Dark Theme CSS File
.p-unreads_view__header {
background: #545454 !important;
color: #222 !important;
}
::-moz-placeholder {
color: #e6e6e6 !important;
filter: none;
opacity: 0.5;
}
@dannydickson
dannydickson / dynamic-classes-wp-menu-items.php
Created October 19, 2019 00:01
Add dynamic ACF classes to WordPress menu items (used for dynamically changing colors based on ACF field. Utilizes Tailwind CSS utility classes)
/**
* Adds custom classes to WP Menu Items in Primary theme menu (header)
*/
function header_menu_classes( $classes, $item, $args ) {
// Store primary color and saturation from ACF as variable
$primary_color = get_field('primary_color', 'option');
$primary_color_saturation = get_field('primary_color_saturation', 'option');
// If menu-1 aka primary theme menu filter the classes for WP menu-items
if ( 'menu-1' === $args->theme_location ) {
// adds custom classes including dynamic primary color
@dannydickson
dannydickson / add-link-to-wp-admin-bar.php
Last active February 11, 2020 18:46
Add custom link to WP admin bar
@dannydickson
dannydickson / tailwind-navigation-with-mobile-slide-in.html
Created February 20, 2020 13:12
Tailwind Navigation Example with Mobile Off-Screen Menu
<! –– Taken from Adam Wathan here:https://polished-sunset-0ex44e5cb9xt.tailwindcss.com/previews/mZOl4nEdBiYkg9Nw ––>
<div class="bg-gray-200" style="min-height: 640px;">
<div id="nav" class="bg-white shadow">
<div class="md:px-8">
<nav
class="relative flex flex-wrap items-center justify-between md:py-4"
>
<div class="relative z-10 flex-shrink-0 pl-4 py-4 md:p-0">
<img class="h-8 w-8" src="/img/example-logo.svg" alt="" />
@dannydickson
dannydickson / tailwind-profile-button.html
Created February 20, 2020 13:15
Tailwind Profile Button with Dropdown and Avatar Header
<! –– Taken from https://polished-sunset-0ex44e5cb9xt.tailwindcss.com/previews/mZOl4nEdBiYkg9Nw ––>
<div id="dropdown" class="relative inline-block">
<button
@click="isOpen = true"
class="inline-flex items-center pl-6 pr-2 py-2 font-semibold text-white bg-gray-800 rounded-lg hover:bg-gray-700 focus:outline-none focus:shadow-outline active:bg-gray-900"
>
Account
<svg
class="ml-2 h-6 w-6 text-white"