Design Meets Code

Design Meets Code

WordPress · PrestaShop

  • Startseite
  • WordPress
  • PHP / Datenbanken
  • Ubuntu
  • Prestashop
  • Grafik
  • Glossar

DNS Prefetch Code in WordPress entfernen

5. Mai 2024 Leave a Comment

Im Quelltext einer WordPress Seite findet sich der Code

<link rel=“dns-prefetch“ href=’//fonts.googleapis.com‘ />

Um diesen zu entfernen, folgenden Code in die functions.php des Themes eintragen

function remove_dns_prefetch( $hints, $relation_type ) {
if ( 'dns-prefetch' === $relation_type ) {
return array_diff( wp_dependencies_unique_hosts(), $hints );
}
return $hints;
}
add_filter( 'wp_resource_hints', 'remove_dns_prefetch', 10, 2 );

Weitere Informationen auf wordpress.org im Forum

Filed Under: WordPress

WooCommerce: Marke nach Produktkurzbeschreibung zeigen

12. November 2022 Leave a Comment

Um einem Produkt Marken als Produktmerkmal hinzuzufügen, ist ein zusätzliches Plugin notwendig, z.B.

Perfect Brands for WooCommerce


oder
https://yithemes.com/themes/plugins/yith-woocommerce-brands-add-on/

function display_single_product_brand_after_summary() {
global $products;
$product_id = $product->id;
$product_brands = get_the_term_list($product_id, 'product_brand', '', ',' );
if (!empty($product_brands)) echo __( "Brand: ", "slug of theme" ) . $product_brands ;
};
add_action( 'woocommerce_single_product_summary', 'display_single_product_brand_after_summary', 40, 0 );

Filed Under: Allgemein, WordPress Tagged With: WooCommerce

Shortcode / Text nach oder vor Produktpreis anzeigen

2. August 2022 Leave a Comment

/**
* Show short code after price on single product
*/
function cw_change_product_price_display( $price ) {
$price .= do_shortcode('[xyz]');
return $price;
}
//add_filter( 'woocommerce_get_price_html', 'cw_change_product_price_display' );

oder

add_filter( 'woocommerce_get_price_html', 'cw_change_product_price_display' );
add_filter( 'woocommerce_cart_item_price', 'cw_change_product_price_display' );
function cw_change_product_price_display( $price ) {
// Your additional text in a translatable string
$text = __('TEXT');

// returning the text before the price
return $text . ' ' . $price;
}

Quelle: https://stackoverflow.com/questions/47016425/add-a-custom-text-before-the-price-display-in-woocommerce

Filed Under: WordPress Tagged With: WooCommerce

  • « Previous Page
  • 1
  • 2
  • 3
  • 4
  • …
  • 20
  • Next Page »
Anzeige

Themen

Apache BuddyPress Code Snippets Datenbank Email Enfold genesis Grid View htaccess Indesign Katalogpreisregel Layout Builder LibreOffice Lieferschein List View Medien MegaShop Mitgliederbereich MySQL PHP PHP Anfänger PHP Variablen Plugins Prestashop Prestashop 1.5 Prestashop 1.6 Prestashop 1.7 Prestashop 8 Prestashop Module Registrierung RSS Feed s2member Server Sicherheit ssl Startseite Strings Tag Cloud Tipps Windows Windows 10 Windows 11 WooCommerce WooCommerce Sortierung WordPress
Anzeige

Letzte Kommentare

  • Martin bei CSS: Automatische Silbentrennung in einzelnen Wörtern verhindern
  • Martin bei CSS: Automatische Silbentrennung in einzelnen Wörtern verhindern
  • Klaus bei Woocommerce: Shop Seiten neu generieren
  • Thomas bei WordPress: Einzelne Kategorien aus dem RSS Feed ausschließen
  • Bernhard bei CSS: Automatische Silbentrennung in einzelnen Wörtern verhindern

Informationen

  • Kontakt
  • Datenschutzerklärung
  • Impressum
  • Cookie-Richtlinie (EU)
  • Kontakt
  • Datenschutzerklärung
  • Impressum
  • Cookie-Richtlinie (EU)
Anzeige