Design · PHP · Server

Design · PHP · Server

WordPress · Drupal · PrestaShop

  • Startseite
  • WordPress
  • PHP
  • Ubuntu
  • Prestashop
  • Indesign
  • Grafik
You are here: Home / WordPress / Masonry Layout für WooCommerce Produkte

Masonry Layout für WooCommerce Produkte

21. April 2020 Leave a Comment

Um auf der Shopseite oder in Kategorie-Archiven von WooCommerce die Artikel im Masonry Layout aufzulisten, hilft folgende Funktion im Childtheme

// Load isotope scripts on the shop pages
add_action( 'wp_footer', function() {
	if ( wpex_is_woo_shop() || wpex_is_woo_tax() ) {
		wpex_enqueue_isotope_scripts();
	}
} );

// Add masonry classname to WooCommerce grid
add_filter( 'wpex_woo_loop_wrap_classes', function( $classes ) {
	if ( is_array( $classes ) ) {
		$classes[] = 'wpex-masonry-grid';
	} else {
		$classes .= ' wpex-masonry-grid';
	}
	return $classes;
} );

// Add masonry class to woo entries
add_filter( 'post_class', function( $classes, $class = '', $post_id = '' ) {
	if ( wpex_is_woo_shop() || wpex_is_woo_tax() ) {
		$classes[] = 'isotope-entry';
	}
	return $classes;
}, 60, 3 );

Quelle: https://wpexplorer-themes.com/total/snippets/apply-masonry-layout-to-woocommerce-shop/

Filed Under: WordPress Tagged With: WooCommerce

Schreibe einen Kommentar Antworten abbrechen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

Themen

Adminbar Apache Attachment Count Automatische Updates Backend Boolean values Boolesche Werte BuddyPress Code Snippets Concatenation Operator Conditional Statement Datenbank Email Enfold Escape Zeichen Galerien genesis Grid View htaccess Layout Builder List View Logische Operatoren Loops Maskieren Media Manager Mitgliederbereich PHP PHP Anfänger PHP Variablen Plugins Prestashop Prestashop 1.5 Prestashop 1.6 Prestashop Module Registrierung RSS Feed s2member Server ssl Strings Windows Windows 10 WooCommerce WooCommerce Sortierung WordPress

Letzte Kommentare

  • Thomas bei WordPress: Einzelne Kategorien aus dem RSS Feed ausschließen
  • Bernhard bei CSS: Automatische Silbentrennung in einzelnen Wörtern verhindern
  • Bernhard bei CSS: Automatische Silbentrennung in einzelnen Wörtern verhindern
  • MC bei PHP: Boolesche Werte (Boolean Values)
  • eno bei Zufällige Produktanordnung beim Featured Product Slider (PrestaShop 6.1.11 / Megashop Theme)

Informationen

  • Kontakt
  • Datenschutzerklärung
  • Impressum
  • Kontakt
  • Datenschutzerklärung
  • Impressum