Livrare 20kg plus

add_action( ‘woocommerce_after_shipping_rate’, ‘action_after_shipping_rate’, 20, 2 ); function action_after_shipping_rate ( $method, $index ) { // Targeting checkout page only: if( is_cart() ) return; // Exit on cart page if( ‘flat_rate:1’ === $method->id ) { echo __(“ Cheltuielile de livare nu sunt…Continue reading

Add Image Alt Text automatic

function add_alt_text_to_images( $html ) { // Check if the image has a title attribute if ( preg_match( ‘/(title=[“\’].*?[“\’])/’, $html, $matches ) ) { // Get the title $title = substr( $matches[0], 7, -1 ); // Check if the image has…Continue reading

Noindex Products under a Product Category

add_filter( ‘aioseo_robots_meta’, ‘aioseo_filter_robots_meta’ ); function aioseo_filter_robots_meta( $attributes ) { if ( has_term( ‘CategoryName’, ‘product_cat’ ) ) { $attributes[‘noindex’] = ‘noindex’; } return $attributes; }Continue reading

Disable SEO Preview feature

add_action( ‘init’, function() { if ( ! function_exists( ‘aioseo’ ) ) { return; } remove_action( ‘wp’, [ aioseo()->standalone->seoPreview, ‘init’ ] ); }, 100);Continue reading

Remove the Canonical URL for a specific URL

add_filter( ‘aioseo_canonical_url’, ‘aioseo_filter_canonical_url’ ); function aioseo_filter_canonical_url( $url ) { if (strpos($url,’/properties/’) !== false) { $url = home_url( $_SERVER[‘REQUEST_URI’] ); } return $url; }Continue reading