// Modify single product images: add carousel functionality | |
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 ); | |
add_action( 'woocommerce_before_single_product_summary', function(){ | |
global $product; | |
$image_ids = []; | |
// featured image | |
if( has_post_thumbnail() ) $image_ids[] = get_post_thumbnail_id(); |
When running WordPress or ClassicPress using a DigitalOcean managed MySQL database you may experience errors like the following:
Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'dbname.wp_posts.post_date' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by for query SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/themename/404.php'), the_widget, WP_Widget_Archives->widget, wp_get_archives
>Expression #1 of ORDER BY clause is not in SELECT list, references column 'dbname.wp_posts.post_date' which is not in SELECT list; this is incompatible with DISTINCT fo
#!/usr/bin/env bash | |
set -e | |
# usage: | |
# $ ./encode.sh [INPUT_FILE] | |
# | |
# NOTE: The output directory is defined in the script (below) because I use this script with Hazel | |
# START CONFIGURATION ================== |
Snippets frequently used with Sage
function fadeOut(el){ | |
el.style.opacity = 1; | |
(function fade() { | |
if ((el.style.opacity -= .1) < 0) { | |
el.style.display = "none"; | |
} else { | |
requestAnimationFrame(fade); | |
} | |
})(); |
Open the Terminal app on Mac.
Change directories so that you are in your user's .ssh
directory. For example, my user directory is named "Eric" so I would type the following into Terminal:
cd /Users/Eric/.ssh
Now you need to generate your SSH key pairs. Enter the following command into Terminal (source 1, source 2):
ssh-keygen -t rsa
<?php | |
// check if WooCommerce is activated | |
function tld_wc_check(){ | |
if ( class_exists( 'woocommerce' ) ) { | |
global $tld_wc_active; | |
$tld_wc_active = 'yes'; | |
} else { |
<?php | |
// -- For debugging enable XML Logging for specfic site_id | |
function ws_debug_xml_post() { | |
// Only capture XMLRPC requests. | |
if (XMLRPC_REQUEST) { | |
$logline = "XML POST: ".date('Y-m-d H:i:s')." ".str_repeat('-', 30)."\n"; |
<style> | |
.header { | |
background-image: url(http://local.dev/wp-content/uploads/2016/04/image-300x151.png) | |
} | |
@media only screen and (min-width: 300px) {.header { | |
background-image: url(http://local.dev/wp-content/uploads/2016/04/image-768x386.png) | |
}} | |
@media only screen and (min-width: 768px) {.header { | |
background-image: url(http://local.dev/wp-content/uploads/2016/04/image-1024x515.png) | |
}} |