Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View dannydickson's full-sized avatar

Danny D. dannydickson

View GitHub Profile
@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 / 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 / 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 / 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 / vanilla-match-height-divi.js
Last active July 31, 2018 20:34
Vanilla JS Match Height
<script>
(function($) {
function matchHeight() {
function setHeight(elementH) {
var maxH = 0;
var len = $(elementH).length;
$(elementH).css("min-height", "");
@dannydickson
dannydickson / material-hover.css
Last active July 17, 2018 20:21
Material Hover Effect
.div {
box-shadow: 0 1px 2px rgba(0,0,0,0.1);
transition: box-shadow 0.3s ease-in-out;
}
.div:hover {
box-shadow: 0 0px 30px rgba(13,115,142,0.2);
}
@dannydickson
dannydickson / update-text-divi-mobile-menu.php
Last active March 1, 2018 17:58
Update "Select Page" Text Divi Mobile Menu
<?php
/* Place the code below in your functions.php file. Do Not Include the opening PHP tag above. In the code, look for the "return" and change the word 'Menu' inside the quotation marks to what ever you want to show up in the mobile menu */
// Update "Select Page" Mobile Menu Text
add_filter('gettext', 'change_select_page_text', 20, 3);
function change_select_page_text($text, $orig, $domain ) {
if ($domain == 'Divi' and $orig == 'Select Page') { return 'Menu'; }
return $text;
}
@dannydickson
dannydickson / image-grid-overlay.css
Last active December 12, 2017 15:39
Adds a full-width Image grid with cool hover effect to Divi.
.image-overlay {
background-color:rgba(0,0,0, 0.7);
position:absolute;
height:100%;
width:100%;
opacity: 1;
transition:opacity 1s;
}
.image-overlay-wrapper .et_pb_button {
@dannydickson
dannydickson / divi-slider-jake.css
Last active December 12, 2017 15:23
Divi Slider with bottom aligned overlay
/*----------------------------
Slider Customization
created by: Jake Smith
----------------------------*/
/* Blue box sizing and spacing */
/* Entire Slider */
#cm-slider .et_pb_slider {
}