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 / slick_slider
Last active May 24, 2018 16:11
Functions, jQuery, HTML, and CSS to get started with Slick Slider in WordPress using ACF.
<?php /* FUNCTIONS */ ?>
<?php
///////////////////
// ENQUEUE SLICK //
///////////////////
function enqueue_slick() {
wp_enqueue_script( 'slick-js', '//cdn.jsdelivr.net/jquery.slick/1.4.1/slick.min.js', 'jquery', '1.4.1' );
wp_enqueue_script( 'slick-init-js', trailingslashit( get_stylesheet_directory_uri() ) . 'js/slick-init.js', 'jquery', 1.0 );
@landbryo
landbryo / create
Last active June 1, 2018 17:50
Use these examples to create or modify tables in Fuel CMS.
# CUSTOMIZED
CREATE TABLE `aircraft` (
`id` tinyint(3) UNSIGNED NOT NULL auto_increment,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`slug` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`content` text COLLATE utf8_unicode_ci NOT NULL,
`image` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`thumbnail_image` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`precedence` int(11) NOT NULL DEFAULT '0',
<?php
/*
Plugin Name: Plugin Opener
Plugin URI:
Description:
Version: 1.0
Author: landbryo
Author URI: https://scree.it
License: GPLv2
*/
@landbryo
landbryo / hash-add.html
Last active May 23, 2018 15:07
Adds hashtag to URL based on selected option.
<script>
var url = window.location.href;
if (url.search("country=") >= 0) {
window.location.hash = "#locator";
}
</script>
<a name="locator"></a>
@landbryo
landbryo / admin_menu
Last active May 24, 2018 16:09
Creates menu in WordPress admin bar.
// ADD TOOLBAR MENU ITEMS //
function add_scree_toolbar($admin_bar){
$menuName = 'You Menu Name';
$screeMenu = wp_get_nav_menu_items($menuName);
$admin_bar->add_menu(array(
'id' => 'parent-item',
'title' => 'Menu',
'href' => '#',
'meta' => array(
@landbryo
landbryo / get_password
Last active May 23, 2018 15:05
Retrieves password for requested email account in Plesk Linux.
Plesk email users often get their passwords lost.
Fortunately Parallels has implemented a command to see all passwords for all users in all domains:
`/usr/local/psa/admin/bin/mail_auth_view`
You can filter the output to see one account password (quotes must exist):
`/usr/local/psa/admin/bin/mail_auth_view | grep "johnsmith@domain.tld"`
@landbryo
landbryo / sheets_filter
Last active May 23, 2018 15:06
Detailed description in file.
`=filter( A2:I, search("Yes", I2:I) )`
### Determins where you start and end. This example starts in cell A2 and ends before column I begins ###
`A2:I`
### Term to search for ###
`"Yes"`
### Determins where you return the results. This example returns the results in column I starting at cell I2 ###
`I2:I`
@landbryo
landbryo / git-commands
Last active May 23, 2018 15:06
Git commands I've come to find useful and want to find in one place.
git clone https:// // clone repository
git add -A // stages all
git add . // stages new and modified, without deleted
git add -u // stages modified and deleted, without new
git commit -m "add message here" //commit changes with a message
git push origin master //push changes to master branch
git reset --hard
git pull
jQuery('img').removeAttr('title');
@landbryo
landbryo / wp_change_img_editor
Last active May 24, 2018 19:20
Use this function or something similar to change the image editor it is using. This will often fix media library image upload problems. Helpful resources: https://developer.wordpress.org/reference/hooks/wp_image_editors/ https://developer.wordpress.
///////////////////////
// CHANGE IMG EDITOR //
///////////////////////
function landbryo_img_edit($array) {
return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
}
add_filter( 'wp_image_editors', 'landbryo_img_edit' );