Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

TrueQAP trueqap

🎯
Focusing
View GitHub Profile
@trueqap
trueqap / toinnodb.sh
Created Jul 31, 2020
WordPress MyISAM to InnoDB with CLI
View toinnodb.sh
#!/usr/bin/env bash
WP_TABLES=($(wp db query "SHOW TABLE STATUS WHERE Engine = 'MyISAM'" --allow-root --silent --skip-column-names | awk '{ print $1}'))
for WP_TABLES in ${WP_TABLES[@]}
do
echo "Converting ${WP_TABLES} to InnoDB"
wp db query "ALTER TABLE ${WP_TABLES} ENGINE=InnoDB" --allow-root
echo "Converted ${WP_TABLES} to InnoDB"
@trueqap
trueqap / function.php
Last active Jul 28, 2020
disable_autofocus_firstname
View function.php
<?php
function disable_autofocus_firstname($fields) {
$fields['billing_first_name']['autofocus'] = false;
$fields['billing_last_name']['autofocus'] = false;
return $fields;
}
add_filter('woocommerce_checkout_fields', 'disable_autofocus_firstname');
@trueqap
trueqap / functions.php
Created Jul 24, 2020
Számlázási adatok eltüntetése
View functions.php
<?php
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
function custom_override_checkout_fields( $fields ) {
unset($fields['billing']['billing_first_name']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_address_1']);
unset($fields['billing']['billing_address_2']);
@trueqap
trueqap / woo.php
Created Jun 18, 2020
List WooCommerce Product by Total sales
View woo.php
<?php
$args = array(
'post_type' => 'product',
'meta_key' => 'total_sales',
'orderby' => 'meta_value_num',
'posts_per_page' => 1,
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
global $product; ?>
@trueqap
trueqap / woo.php
Created Jun 18, 2020
List WooCommerce Product by Total sales
View woo.php
<?php
$args = array(
'post_type' => 'product',
'meta_key' => 'total_sales',
'orderby' => 'meta_value_num',
'posts_per_page' => 1,
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
global $product; ?>
@trueqap
trueqap / woo-fix.php
Created May 27, 2020
Divi woo 3 products per row
View woo-fix.php
<?php
add_filter('loop_shop_columns', 'loop_columns', 999);
if (!function_exists('loop_columns')) {
function loop_columns() {
return 3; // 3 products per row
}
}
@trueqap
trueqap / style.css
Created May 8, 2020
Facebook messenger icon position to left
View style.css
.fb_dialog.fb_dialog_advanced {
left: 18pt;
}
iframe.fb_customer_chat_bounce_in_v2 {
left: 9pt;
}
iframe.fb_customer_chat_bounce_out_v2 {
left: 9pt;
}
View javitas.php
<?php
add_filter('loop_shop_columns', 'loop_columns', 999);
if (!function_exists('loop_columns')) {
function loop_columns() {
return 3; // 3 products per row
}
}
@trueqap
trueqap / style.css
Created Mar 9, 2020
Divi hide cart from header
View style.css
#et-secondary-menu a.et-cart-info {
display:none;
}
View Style.css
body.et_pb_button_helper_class .et_pb_button, body.et_pb_button_helper_class.et-db #et-boc .et-l .et_pb_button, body.et_pb_button_helper_class .et_pb_module.et_pb_button, body.et_pb_button_helper_class.et-db #et-boc .et-l .et_pb_module.et_pb_button, .woocommerce.et_pb_button_helper_class a.button.alt, .woocommerce.et_pb_button_helper_class.et-db #et-boc .et-l a.button.alt, .woocommerce-page.et_pb_button_helper_class a.button.alt, .woocommerce-page.et_pb_button_helper_class.et-db #et-boc .et-l a.button.alt, .woocommerce.et_pb_button_helper_class button.button.alt, .woocommerce.et_pb_button_helper_class.et-db #et-boc .et-l button.button.alt, .woocommerce.et_pb_button_helper_class button.button.alt.disabled, .woocommerce.et_pb_button_helper_class.et-db #et-boc .et-l button.button.alt.disabled, .woocommerce-page.et_pb_button_helper_class button.button.alt, .woocommerce-page.et_pb_button_helper_class.et-db #et-boc .et-l button.button.alt, .woocommerce-page.et_pb_button_helper_class button.button.alt.disabled, .woo
You can’t perform that action at this time.