Skip to content

Instantly share code, notes, and snippets.

View MrCoker's full-sized avatar

Mr Coker MrCoker

View GitHub Profile
@MrCoker
MrCoker / functions.php
Created October 3, 2019 15:02
Adding Template Parts with Shortcode
<?php
// Add a shorcode to get the template part
function makeagency_shortcode() {
ob_start();
get_template_part('templates/this', 'template');
return ob_get_clean();
}
add_shortcode( 'tax_calculator', 'makeagency_shortcode' );
// Check the post for the shortcode and enque the scripts
@MrCoker
MrCoker / jquery
Last active December 4, 2019 11:30
jQuery function: Clone
jQuery: Clone an existing jQuery function
```
var staticButton = $(".sticky-footer--wrapper button").clone().addClass("payment-button");
$(".cart-info.delivery-payment-sidebar").append(staticButton);
```
@MrCoker
MrCoker / owl-carousel.js
Last active December 4, 2019 11:25
Stop carousels from autoplaying for development
@MrCoker
MrCoker / slick-slider.js
Last active April 23, 2020 16:10
Pause carousel from autoplaying for development
$('.home_banner').slick('slickPause');
@MrCoker
MrCoker / jquery.js
Created December 12, 2019 16:45
Document Ready
/**
* Document ready loads when the browser has passed from the top all the way to the bottom
*/
// Standard
$(document).ready(function(){
});
// Shorthand
$(function(){
});
@MrCoker
MrCoker / howto.md
Last active March 3, 2022 20:11 — forked from aaronsummers/howto.md
Import Database into MAMP using terminal
@MrCoker
MrCoker / .htaccess
Created January 17, 2020 12:14 — forked from aaronsummers/.htaccess
redirect localhost images from wordpress to production server
# my local and production sites use /blog/ as a directory for WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/blog/wp-content/uploads/[^\/]*/.*$
RewriteRule ^(.*)$ https://www.example.com/blog/$1 [QSA,L]
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On