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
import $ from 'jquery'; | |
const NAME = 'swapImage'; | |
const DATA_KEY = `decathlon.${NAME}`; | |
const EVENT_KEY = `.${DATA_KEY}`; | |
const ClassName = { | |
CURRENT: 'is-current', | |
LOADING: 'is-loading' | |
}; |
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
/** | |
* Remove the slug from published post permalinks. | |
* Only affect our CPT though. | |
*/ | |
function vipx_remove_cpt_slug( $post_link, $post, $leavename ) { | |
if ( ! in_array( $post->post_type, array( 'event' ) ) | |
|| 'publish' != $post->post_status ) | |
return $post_link; | |
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 Variables to Make Registering CPTs Easier | |
/* ------------------------------------------------- */ | |
function register_my_cpt_name() { | |
$name = 'My Custom Post Type' ; | |
$singular = 'The Custom Post Types' ; |
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 | |
/* ————————————————————————— */ | |
/* ACF Inline SVGs | |
/* ————————————————————————— */ | |
$repeater = 'repeater_field_name' | |
if ( have_rows( $repeater ) ): ?> | |
<section class="content-main"> | |
<div class="container"> <?php |
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
# =============================================================== # | |
# My Personal .bash_profile | |
# Author: derek shirk | |
# Website: derekshirk.com | |
# Subscribe to my newsletter mergelinks.com | |
# =============================================================== # | |
# =============================================================== # | |
# Aliases |
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
##Use cli aliases. | |
I love git’s cli and prefer to use it most of times while performing active operations (commit, push, checkout etc.). There is a chance that you’ll get tired of typing the same command on and on and that’s when you find your life-saver represented by git aliases. | |
$ git config --global alias.co "checkout" | |
$ git config --global alias.cmm "commit -m" | |
$ git config --global alias.rh "reset HEAD" | |
$ git config --global alias.rhh "reset HEAD --hard"' |
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 | |
$file = dirname(__FILE__) . '/your-main-plugin-file.php'; | |
$plugin_url = plugin_dir_url($file); | |
$plugin_path = plugin_dir_path($file); |
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 | |
add_action( 'admin_enqueue_scripts', 'load_admin_custom_script' ); | |
function load_admin_custom_script() { | |
$current_screen = get_current_screen(); | |
if ( $current_screen->post_type === 'custom_post_type_name' ) { | |
$ss_url = get_bloginfo('stylesheet_directory'); | |
wp_enqueue_script('jquery'); |
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
@media only screen and (min-width: 768px), | |
screen and (width:768px) and (resolution: 163dpi) { | |
} | |
@media only screen and (min-width: 960px) { | |
} |
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 | |
function grav_get_svg($svg){ | |
$path = get_stylesheet_directory().'/library/images/svgs/'.$svg; | |
if(file_exists($path)){ | |
return file_get_contents($path); | |
} return ''; | |
} |
NewerOlder