Skip to content

Instantly share code, notes, and snippets.

Danny D. dannydickson

Block or report user

Report or block dannydickson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dannydickson
dannydickson / tailwind-profile-button.html
Created Feb 20, 2020
Tailwind Profile Button with Dropdown and Avatar Header
View tailwind-profile-button.html
<! –– 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"
@dannydickson
dannydickson / tailwind-navigation-with-mobile-slide-in.html
Created Feb 20, 2020
Tailwind Navigation Example with Mobile Off-Screen Menu
View tailwind-navigation-with-mobile-slide-in.html
<! –– 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 / add-link-to-wp-admin-bar.php
Last active Feb 11, 2020
Add custom link to WP admin bar
View add-link-to-wp-admin-bar.php
@dannydickson
dannydickson / dynamic-classes-wp-menu-items.php
Created Oct 19, 2019
Add dynamic ACF classes to WordPress menu items (used for dynamically changing colors based on ACF field. Utilizes Tailwind CSS utility classes)
View dynamic-classes-wp-menu-items.php
/**
* 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 / dark-theme.css
Last active Aug 20, 2019
My Slack Dark Theme CSS File
View dark-theme.css
.p-unreads_view__header {
background: #545454 !important;
color: #222 !important;
}
::-moz-placeholder {
color: #e6e6e6 !important;
filter: none;
opacity: 0.5;
}
@dannydickson
dannydickson / sort-by-custom-field.php
Last active Jul 11, 2019
Sort by custom field in WordPress
View sort-by-custom-field.php
<?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
View material-icons-list-for-dropdown.txt
3d_rotation
ac_unit
access_alarm
access_alarms
access_time
accessibility
accessible
account_balance
account_balance_wallet
account_box
@dannydickson
dannydickson / hide-gravity-forms-labels.php
Created Jun 29, 2019
Enable: Hide Gravity Forms Labels
View hide-gravity-forms-labels.php
// 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 Jun 29, 2019
Enable: Hide Gravity Forms Labels
View hide-gravity-forms-labels.php
// 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 / corporate-pro-genesis-superfish-menu-breakpoint-fix.css
Last active Aug 23, 2018
Corporate Pro Genesis Superfish Menu Breakpoint Fix
View corporate-pro-genesis-superfish-menu-breakpoint-fix.css
/* ========================
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) {
You can’t perform that action at this time.