Notizen & Code-Anpassungen

Am Ende von functions.php, um die Kurzbeschreibung direkt auf der Hauptseite vom Shop anzuzeigen

add_action( 'woocommerce_after_shop_loop_item', 'woo_show_excerpt_shop_page', 5 );
function woo_show_excerpt_shop_page() {
	global $product;

	echo $product->post->post_excerpt;
}

Um kostenlosen Versand automatisch anzuzeigen, auch wenn es normalen Versand gibt

/**
 * Alle anderen Lieferkosten ausblenden, wenn ein kostenloser Versand möglich ist
 */
function my_hide_shipping_when_free_is_available( $rates ) {
	$free = array(); foreach ( $rates as $rate_id => $rate ) {
		if ( 'free_shipping' === $rate->method_id ) {
			$free[ $rate_id ] = $rate; break; 
		} 
	} return ! empty( $free ) ? $free : $rates; 
} add_filter( 'woocommerce_package_rates', 'my_hide_shipping_when_free_is_available', 100 );

Eigene Währung EUR

/**
 * Eigene Währung
 */

add_filter( 'woocommerce_currencies', 'add_my_currency' );
function add_my_currency( $currencies ) {
$currencies['EUR'] = __( 'Euro ausgeschrieben', 'woocommerce' );
return $currencies;
}
  
add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2);
  
function add_my_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
case 'EUR': $currency_symbol = 'EUR'; break;
}
return $currency_symbol;
}

RSS entfernen

/**
 * RSS und Google Fonts entfernen
 */
function itsme_disable_feed() {
 wp_die( __( 'No feed available, please visit the <a href="'. esc_url( home_url( '/' ) ) .'">homepage</a>!' ) );
}

add_action('do_feed', 'itsme_disable_feed', 1);
add_action('do_feed_rdf', 'itsme_disable_feed', 1);
add_action('do_feed_rss', 'itsme_disable_feed', 1);
add_action('do_feed_rss2', 'itsme_disable_feed', 1);
add_action('do_feed_atom', 'itsme_disable_feed', 1);
add_action('do_feed_rss2_comments', 'itsme_disable_feed', 1);
add_action('do_feed_atom_comments', 'itsme_disable_feed', 1);

remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'feed_links', 2 );

Zusätzliches CSS

.site-info { display: none; }

.product_meta .posted_in {display: none !important;}

/* WooCommerce Short Description Text Color */
.woocommerce-Price-amount {
color: #000000;
font-weight: bold;
}
function just_disable_default_runner() {
    if ( class_exists( 'ActionScheduler' ) ) {
        remove_action( 'action_scheduler_run_queue', array( ActionScheduler::runner(), 'run' ) );
    }
}
//Remove WordPress.org Dns-prefetch.
remove_action('wp_head', 'wp_resource_hints', 2);

header.php

<meta name="description" content="" />