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
https://gtmetrix.com/ | |
https://gtmetrix.com/blog/how-to-read-a-waterfall-chart-for-beginners/ | |
https://www.webpagetest.org/ | |
https://wordpress.org/plugins/query-monitor/ | |
https://github.com/crstauf/query-monitor-extend | |
https://newrelic.com/products/application-monitoring | |
https://help.nexcess.net/74095-wordpress/configure-new-relic-monitoring | |
https://wordpress.org/plugins/wp-newrelic/ |
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
<script> | |
jQuery(document).ready(function($) { | |
$('.ct-filter').on( 'click', function(event){ | |
var $type = $(this).data("filter"); | |
if($type == "all"){ | |
$('.type-product').fadeOut(0); | |
$('.type-product').fadeIn(500); | |
} else { | |
$('.type-product').hide(); | |
// For CPTs just change the category class to your CPTs slug for example: '.projects-' |
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
<script> | |
jQuery(document).ready(function($) { | |
$('.ct-filter').on( 'click', function(event){ | |
var $type = $(this).data("filter"); | |
if($type == "all"){ | |
$('.entry-card').fadeOut(0); | |
$('.entry-card').fadeIn(500); | |
} else { | |
$('.entry-card').hide(); | |
// For CPTs just change the category class to your CPTs slug for example: '.projects-' |
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 slug_order_archive_by_field( $query ) { | |
//Only do if is main query fo a specific cpt's archive. | |
//@TODO set cpt's name | |
if ( $query->is_main_query() && is_post_type_archive( 'CPT_NAME' ) ) { | |
//@TODO Set the name of the field we are ordering by | |
$query->set( 'meta_key', 'FIELD_NAME' ); | |
//@TODO change order to DESC IF you want to go in reverse order | |
$query->set( 'order', 'ASC' ); | |
//@TODO uncomment next line IF you want to sort by an integer instead of alphabetically |
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 | |
/* | |
* Readme: To use, place this snippet in your functions.php. | |
*/ | |
add_filter('wp_link_pages', 'bootstrap_wp_link_pages'); | |
function bootstrap_wp_link_pages($wp_links){ | |
global $post; | |
// Generate current page base url without pagination. | |
$post_base = trailingslashit( get_site_url(null, $post->post_name) ); |
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 | |
# Register custom post types on the 'init' hook. | |
add_action( 'init', 'my_register_post_types' ); | |
/** | |
* Registers post types needed by the plugin. | |
* | |
* @since 1.0.0 | |
* @access public |
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
(function() { | |
var CSSCriticalPath = function(w, d, opts) { | |
var opt = opts || {}; | |
var css = {}; | |
var pushCSS = function(r) { | |
if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
for(var i = 0; i < styles.length; i++) { | |
if(!!styles[i] === false) continue; | |
var pair = styles[i].split(": "); |
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: 320px) { | |
/* Small screen, non-retina */ | |
} | |
@media | |
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px), | |
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px), | |
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px), |
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
<? | |
if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['insert_post'] )) { //check that our form was submitted | |
$title = $_POST['thread_title']; //set our title | |
if ($_POST['thread_description']=="") { // check if a description was entered | |
$description = "See thread title..."; // if not, use placeholder | |
} else { | |
$description = $_POST['thread_description']; //if so, use it |
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_image_size('thumbnail-bw', 400, 0, false); | |
add_filter('wp_generate_attachment_metadata','bw_images_filter'); | |
function bw_images_filter($meta) { | |
$file = wp_upload_dir(); | |
$file = trailingslashit($file['path']).$meta['sizes']['thumbnail-bw']['file']; | |
list($orig_w, $orig_h, $orig_type) = @getimagesize($file); | |
$image = wp_load_image($file); | |
imagefilter($image, IMG_FILTER_GRAYSCALE); |
NewerOlder