Skip to content

Instantly share code, notes, and snippets.

View celticwebdesign's full-sized avatar

Darren Stevens celticwebdesign

View GitHub Profile
@celticwebdesign
celticwebdesign / SlickSlider-dots-custom-pagination.js
Last active July 18, 2019 08:56
SlickSlider with dots navigation and custom pagination
// see SeaGrass
if ($(".slideshow-full-container").length > 0) {
// https://github.com/kenwheeler/slick/issues/1403#issuecomment-282066130
// Test for slide length, if one, hide navigation dots
// the event needs to be run before slick is initialized
$('.slideshow-full-container').on('init', function (event, slick, direction) {
// console.log($('#full_page_slideshow .slick-slide').length);
Test
// https://codepen.io/gapcode/pen/vEJNZN
// Check for IE
// used for IE11 for declaration form grid layout
// Get IE or Edge browser version
var version = detectIE();
@celticwebdesign
celticwebdesign / Atom Snippets - Div
Last active January 26, 2019 12:22
// https://snippet-generator.app // VSCode, Sublime Text, Atom
// https://snippet-generator.app
// VSCode, Sublime Text, Atom
'.source.php':
'HTML - div':
'prefix': 'div'
'body': """
<div>
</div>
// https://snippet-generator.app
// VSCode, Sublime Text, Atom
'.source.php':
'Bootstrap Grid - row-col-2':
'prefix': 'row-col-2'
'body': """
<div class="row">
<div class="col-md-6">
<div class="col-left">
@celticwebdesign
celticwebdesign / WordPress search
Created December 19, 2018 12:36
Fixing empty or blank searches from displaying all posts in WordPress
@celticwebdesign
celticwebdesign / jquery - Click button and scroll to element
Created December 11, 2018 09:10
Works on page and from other page.
var top_space = 0;
if( width <= 1023 ) {
top_space = 0;
} else {
top_space = 105;
}
function scroll_to() {
// https://stackoverflow.com/questions/6677035/jquery-scroll-to-element
define('WP_DEBUG', true);
// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);
// Disable display of errors and warnings
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);
var showingSlider = false;
function show_hide_div_on_scroll_jquery() {
if ($(window).scrollTop()>300)
{
if (!showingSlider){
showingSlider=true;
$('#header-hidden').animate({
top: 0,
opacity: 1,
http://wpgear.org
WP-CLI - The command-line tool for managing WordPress.
https://github.com/wp-cli/wp-cli
WordPress-Coding-Standards
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
WP Migrate DB - Migrates your database by running find & replace on URLs and file paths, handling serialized data, and saving an SQL file.
https://wordpress.org/plugins/wp-migrate-db/
// https://kinsta.com/knowledgebase/remove-query-strings-static-resources/
// Remove Query Strings From Static Resources With Code
function _remove_script_version( $src ){
$parts = explode( '?', $src );
return $parts[0];
}
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );