Skip to content

Instantly share code, notes, and snippets.

View trueqap's full-sized avatar
🎯
Focusing

TrueQAP trueqap

🎯
Focusing
View GitHub Profile
@trueqap
trueqap / toinnodb.sh
Created July 31, 2020 13:44
WordPress MyISAM to InnoDB with CLI
#!/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 July 28, 2020 17:30
disable_autofocus_firstname
<?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 July 24, 2020 18:51
Számlázási adatok eltüntetése
<?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 June 18, 2020 15:20
List WooCommerce Product by Total sales
<?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 June 18, 2020 15:20
List WooCommerce Product by Total sales
<?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 11:21
Divi woo 3 products per row
<?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 08:19
Facebook messenger icon position to left
.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;
}
@trueqap
trueqap / javitas.php
Created April 8, 2020 15:32
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 March 9, 2020 17:51
Divi hide cart from header
#et-secondary-menu a.et-cart-info {
display:none;
}
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