Skip to content

Instantly share code, notes, and snippets.

View landbryo's full-sized avatar
🤠
Always Excitied

Landon Otis landbryo

🤠
Always Excitied
View GitHub Profile
@landbryo
landbryo / rm_types_infowindow.php
Last active May 24, 2018 16:17
Remove Types Toolset infowindow from dashboard pages via functions.php
///////////////////////////////
// REMOVE TOOLSET INFOWINDOW //
///////////////////////////////
function remove_types_info_box() {
return false;
}
add_filter( 'types_information_table', 'remove_types_info_box' );
@landbryo
landbryo / wp_add_thumbnail.php
Last active May 24, 2018 16:16
Add WordPress thumbnail size via functions.php
/////////////////////////
// ADD THUMBNAIL SIZES //
/////////////////////////
add_image_size( 'facebook', 476, 249 ); // width x height
@landbryo
landbryo / footer.php
Last active May 24, 2018 16:16
Customized Enfold footer.php that includes a copyright logo and auto changing year.
@landbryo
landbryo / enfold_menu_border.css
Last active May 24, 2018 16:16
Remove Enfold sub-menu border for desktop.
@media only screen and (min-width: 768px) {
.header_color .main_menu ul ul,
.header_color .main_menu .menu ul li a,
.header_color .avia_mega_div,
.header_color .av-subnav-menu > li ul,
.header_color .av-subnav-menu a {
border: none;
}
@landbryo
landbryo / copyrightYear.php
Last active May 24, 2018 16:15
WordPress shortcode [copyYear] to be used in widgets and theme options.
//////////////////////////////
// COPYRIGHT YEAR SHORTCODE //
//////////////////////////////
function copyrightYear(){
return date('Y');
}
add_shortcode('copyYear', 'copyrightYear');
@landbryo
landbryo / remPassNag.php
Last active May 24, 2018 16:15
Function for removing password nag in WordPress.
/////////////////////////
// REMOVE PASSWORD NAG //
/////////////////////////
remove_action('admin_notices','default_password_nag');
@landbryo
landbryo / enable_shortcodes_text_widget.php
Last active May 24, 2018 16:15
Enable shortcodes in text widget.
//////////////////////////////////////
// ENABLE SHORTCODES IN TEXT WIDGET //
//////////////////////////////////////
add_filter('widget_text','do_shortcode');
@landbryo
landbryo / perfect_masonry.php
Last active May 24, 2018 16:14
Masonry grid using ACF, wpfeatherlight, and WordPress.
<style>
.scree_grid:after {
content: '';
display: block;
clear: both;
}
.grid_sizer,
.grid_item {
width: calc(33.333% - 20px);
@landbryo
landbryo / wp_match_height.md
Last active May 24, 2018 16:14
This snippet allows you to use the jQuery Match Height plugin in your WordPress theme.

jQuery Match Height's files and documentation can be found here.

Create a file called match.js to house the matchHeight function:

jQuery(document).ready(function($) {

    $(function() {
        $('.match').matchHeight({
 byRow: true,
@landbryo
landbryo / mysql_dump
Last active May 24, 2018 16:12
Script for dumping a database to /tmp/dbbackup/
#!/bin/sh
rm -rf /tmp/dbbackup/
MYSQL_USER="root"
MYSQL_PASS="password"
NOW=$(date +"%Y-%m-%dT%H_%M_%S")
BACKUP_DIR=/tmp/dbbackup/$NOW
test -d "$BACKUP_DIR" || mkdir -p "$BACKUP_DIR"
# Get the database list, exclude information_schema
for db in $(mysql -B -s -u $MYSQL_USER --password=$MYSQL_PASS -e 'show databases' | grep -v information_schema | grep -v performance_schema)
do