elementor flip card for masonry

enlarges elementor flip card background for masonry layouts.

(() => {
	const elementorFlipBoxEls = document.querySelectorAll('.elementor-flip-box')
	
	if (!elementorFlipBoxEls) {
		return;
	}
	// match elementor flip card height setting
	const outerHeight = 120;
	
	elementorFlipBoxEls.forEach(flipBox => {
		const imgEl = flipBox.querySelector('.elementor-flip-box__image img');
		
		if (!imgEl) {
			return;
		}
		
		flipBox.style.height = (imgEl.clientHeight + outerHeight) + 'px';
	});
})();

gp control footer widths

 .footer-widgets .footer-widget-1 {
    flex-basis: 40%;
}

.footer-widgets .footer-widget-2 {
    flex-basis: 20%;
}

.footer-widgets .footer-widget-3 {
    flex-basis:30%;
}

.footer-widgets .footer-widget-4 {
    flex-basis: 10%;
}

woo add to cart – display price in button with text according to category

add_filter( 'woocommerce_product_add_to_cart_text', 'custom_add_to_cart_price', 20, 2 ); // Shop and other archives pages
add_filter( 'woocommerce_product_single_add_to_cart_text', 'custom_add_to_cart_price', 20, 2 ); // Single product pages

function custom_add_to_cart_price( $button_text, $product ) {
    // Check if the product belongs to a specific category (e.g., 'tickets' or 'camping')
    $categories = array( 'tickets', 'camping' );

    if ( has_term( $categories, 'product_cat', $product->get_id() ) ) {
        $product_price = wc_price( wc_get_price_to_display( $product ) );
        return  strip_tags( $product_price ) . ' Per Person';
    } elseif( $product->is_type('variable') ) {
        // For variable products
        if( ! is_product() ){
            $product_price = wc_price( wc_get_price_to_display( $product, array( 'price' => $product->get_variation_price() ) ) );
            return $button_text . ' - From ' . strip_tags( $product_price );
        } 
        // Single product pages
        else {
            return $button_text;
        }
    } else {
        // For all other product types
        $product_price = wc_price( wc_get_price_to_display( $product ) );
        return  strip_tags( $product_price );
    }
}

wp cli for hacked sites

rm -rf wp-admin

rm -rf wp-includes

wp core download --force --skip-content

wp core verify-checksums

wp plugin install $(wp plugin list --field=name) --force

wp theme install $(wp theme list --field=name) --force

(run wordfence scan)

wp user list --role=administrator
   -remove spammy users
   -verify default user role in General
   -reset salts

woocommerce button color control

.woocommerce #content input.button.alt:hover, .woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover, .woocommerce-page #content input.button.alt:hover, .woocommerce-page #respond input#submit.alt:hover, .woocommerce-page a.button.alt:hover, .woocommerce-page button.button.alt:hover, .woocommerce-page input.button.alt:hover {
background:#126b11;
background-color:#126b11;
color:white !important;
text-shadow: transparent !important;
box-shadow: none;
border-color:#126b11 !important;

}
.woocommerce #content input.button:hover, .woocommerce #respond input#submit:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover, .woocommerce-page #content input.button:hover, .woocommerce-page #respond input#submit:hover, .woocommerce-page a.button:hover, .woocommerce-page button.button:hover, .woocommerce-page input.button:hover {
background:#126b11;
background-color:#126b11;
color:white !important;
text-shadow: transparent !important;
box-shadow: none;
border-color:#126b11 !important;

}
.woocommerce #content input.button, .woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .woocommerce-page #content input.button, .woocommerce-page #respond input#submit, .woocommerce-page a.button, .woocommerce-page button.button, .woocommerce-page input.button {
background: #126b11 !important;
color:white !important;
text-shadow: transparent !important;
border-color:#126b11 !important;
}

.woocommerce #content input.button.alt:hover, .woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover, .woocommerce-page #content input.button.alt:hover, .woocommerce-page #respond input#submit.alt:hover, .woocommerce-page a.button.alt:hover, .woocommerce-page button.button.alt:hover, .woocommerce-page input.button.alt:hover {
background: #126b11 !important;
box-shadow: none;
text-shadow: transparent !important;
color:white !important;
border-color:#126b11;
}

// GeneratePress Search Box Clear

add_filter( 'generate_navigation_search_output', 'tu_remove_search_query' );
function tu_remove_search_query() {
  printf( // WPCS: XSS ok, sanitization ok.
    '<form method="get" class="search-form navigation-search" action="%1$s">
      <input type="search" class="search-field" value="" name="s" title="%2$s" />
    </form>',
    esc_url( home_url( '/' ) ),
    esc_attr_x( 'Search', 'label', 'generatepress' )
  );
}

woocommerce – custom function to override default sort by category

// woo - custom function to override default sort by category
function custom_default_catalog_orderby() {
//choose categories where default sorting will be changed
if (is_product_category( array( 'seasonal' ))) {
    return 'title'; // sort by title
    
}else{
return 'date'; // sort by date as the default
    
  } // end if statement
} //end function
add_filter( 'woocommerce_default_catalog_orderby', 'custom_default_catalog_orderby' ); //add the filter