This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$1" != "" ]; then | |
theme_name=$1 | |
fi | |
FILE=.gitignore | |
if test -f "$FILE"; then | |
echo ".gitignore exists, aborting." | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var | |
// NAV | |
navbutton = $('.menu-toggle'), | |
navWrap = $('.main-nav-wrapper'), | |
navmenu = $('.main-nav'), | |
servicemenu = $('.service-menu'), | |
// WATCHER | |
watcher = window.matchMedia("(max-width: 1179px)"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Command line | |
* | |
* @source https://git.pub/snippets/4 | |
*/ | |
for id in $(wp post list --post_type=my_post_type --fields=ID --format=ids); do wp post update $id --post_title="Page Number $id"; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Enqueue site-wide scripts | |
add_action( 'wp_enqueue_scripts', 'sk_enqueue_scripts' ); | |
function sk_enqueue_scripts() { | |
wp_enqueue_script( 'global', get_stylesheet_directory_uri() . '/js/global.js', array( 'jquery' ), '', true ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Parse the video uri/url to determine the video type/source and the video id */ | |
function parse_video_uri( $url ) { | |
// Parse the url | |
$parse = parse_url( $url ); | |
// Set blank variables | |
$video_type = ''; | |
$video_id = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------------------------------------- | |
# .gitignore for WordPress @salcode | |
# ver 20180808 | |
# | |
# From the root of your project run | |
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore | |
# to download this file | |
# | |
# By default all files are ignored. You'll need to whitelist | |
# any mu-plugins, plugins, or themes you want to include in the repo. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.gform_validation_container, | |
.gform_wrapper .gform_validation_container, | |
body .gform_wrapper li.gform_validation_container, | |
body .gform_wrapper .gform_body ul.gform_fields li.gfield.gform_validation_container, | |
body .gform_wrapper ul.gform_fields li.gfield.gform_validation_container { | |
display: none !important; | |
position: absolute !important; | |
left: -9000px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://support.advancedcustomfields.com/forums/topic/change-menu-position-of-options-page/ | |
acf_add_options_page( array( | |
'page_title' => 'Home Page Sliders', | |
'menu_title' => 'Sliders', | |
'menu_slug' => 'home-page-sliders', | |
'capability' => 'edit_posts', | |
'icon_url' => 'dashicons-images-alt2', | |
'position' => 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* | |
* Use the code at the beginning of a plugin that you want to be laoded at last | |
* | |
*/ | |
function this_plugin_last() { | |
$wp_path_to_this_file = preg_replace('/(.*)plugins\/(.*)$/', WP_PLUGIN_DIR."/$2", __FILE__); | |
$this_plugin = plugin_basename(trim($wp_path_to_this_file)); | |
$active_plugins = get_option('active_plugins'); |
NewerOlder