This file contains hidden or 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 | |
/* | |
* THE FILTER | |
* | |
*/ | |
function custom_responsive_image_sizes($sizes, $img_name, $attachment_id) { | |
$sizes = wp_get_attachment_image_sizes($attachment_id, 'original'); | |
$meta = wp_get_attachment_metadata($attachment_id); | |
$width = $meta['width']; |
This file contains hidden or 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 | |
if(!function_exists('wc_get_products')) { | |
return; | |
} | |
$paged = (get_query_var('paged')) ? absint(get_query_var('paged')) : 1; | |
$ordering = WC()->query->get_catalog_ordering_args(); | |
$ordering['orderby'] = array_shift(explode(' ', $ordering['orderby'])); | |
$ordering['orderby'] = stristr($ordering['orderby'], 'price') ? 'meta_value_num' : $ordering['orderby']; |
This file contains hidden or 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 load_existing_product_gallery_into_acf_gallery_field($field) { | |
global $post; | |
$field['value'] = explode(',', get_post_meta($post->ID, '_product_image_gallery', true)); | |
return $field; | |
} | |
add_filter('acf/load_field/name=product_gallery', 'load_existing_product_gallery_into_acf_gallery_field'); |
This file contains hidden or 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
// Place your key bindings in this file to overwrite the defaults | |
[ | |
{ "key": "ctrl+1", "command": "" }, | |
{ "key": "ctrl+2", "command": "" }, | |
{ "key": "ctrl+3", "command": "" }, | |
{ "key": "ctrl+4", "command": "" }, | |
{ "key": "ctrl+5", "command": "" }, | |
{ "key": "ctrl+6", "command": "" }, | |
{ "key": "ctrl+7", "command": "" }, | |
{ "key": "ctrl+8", "command": "" }, |
This file contains hidden or 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 | |
// Adds initial meta to each attachment | |
function add_initial_file_size_postmeta($column_name, $post_id) { | |
static $query_ran; | |
if($query_ran !== null) { | |
$all_imgs = new WP_Query(array( | |
'post_type' => 'attachment', | |
'post_status' => 'inherit', |
This file contains hidden or 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 | |
global $wp_query; | |
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; | |
$prev_text = __('Newer Posts'); | |
$next_text = __('Older Posts'); | |
// The magic happens here. First we grab the URL and check it for URL params, |
This file contains hidden or 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 (min-width: $screen-sm-min) and (max-width: $screen-sm-max) { | |
.your-row-class > *:nth-child(3n+4) { | |
clear: left; | |
} | |
} |
This file contains hidden or 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
**/node_modules | |
**/node_modules/** | |
.DS_Store | |
config.codekit | |
*.log | |
.htaccess | |
# Ignore everything in the root except the "wp-content" directory. |
This file contains hidden or 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
{ | |
"name": "knight_digital_starter", | |
"version": "1.0.0", | |
"author": "Knight Digital <[email protected]>", | |
"scripts": { | |
"autoprefixer": "postcss -u autoprefixer -r static/dist/css/*", | |
"scss": "node-sass --output-style compressed -o static/dist/css static/src/scss", | |
"lint": "eslint static/src/js", | |
"uglify": "mkdir -p static/dist/js && uglifyjs static/src/js/*.js -m -o static/dist/js/app.js && uglifyjs static/src/js/*.js -m -c -o static/dist/js/app.min.js", | |
"imagemin": "imagemin static/src/img static/dist/img -p", |
This file contains hidden or 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
--- wordpress-importer.php | |
+++ wordpress-importer_fix.php | |
@@ -63,7 +63,7 @@ | |
var $url_remap = array(); | |
var $featured_images = array(); | |
- function WP_Import() { /* nothing */ } | |
+ public function __construct(){ /* nothing */ } | |
/** |