Cum ascundeți fișele pentru descriere WooCommerce

Cum ascundeți fișele – Produsele WooCommerce afișează în mod implicit fisele „descriere” și „recenzii”

de sub produs pe o pagină de produs WordPress,

puteți ascunde aceste file din vizualizare, precum și o a treia filă „informații suplimentare” cu un fragment de cod care merge în fișierul din teme numit: functions.php

Cum ascundeți fișele
Ascundere descriere, recenzii și informații suplimentare
// Add Shortcode
function custom_shortcode() {

	//Remove WooCommerce Tabs - this code removes all 3 tabs - to be more specific just remove actual unset lines 
	
	add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
	
	function woo_remove_product_tabs( $tabs ) {
	
	    unset( $tabs['description'] );      	// Remove the description tab
	    unset( $tabs['reviews'] ); 			// Remove the reviews tab
	    unset( $tabs['additional_information'] );  	// Remove the additional information tab
	
	    return $tabs;
	
	}

}
add_shortcode( '', 'custom_shortcode' );

Cum ascundeți fișele – Pe lângă eliminarea filelor, puteți redenumi titlul din file cu acest fragment de cod WooCommerece

// Add Shortcode
function custom_shortcode() {

	//Rename WooCommerce Tabs - this code renames tabs - just include the tab line you want renamed and change the name in paranthesis, ie 'More Information' etc
	
	add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
	
	function woo_rename_tabs( $tabs ) {
	
		$tabs['description']['title'] = __( 'More Information' );		// Rename the description tab
		$tabs['reviews']['title'] = __( 'Ratings' );				// Rename the reviews tab
		$tabs['additional_information']['title'] = __( 'Product Data' );	// Rename the additional information tab
	
		return $tabs;
	
	}

}
add_shortcode( '', 'custom_shortcode' );

Cum ascundeți – De asemenea, puteți rearanja filele cu acest fragment de cod WooCommerce

// Add Shortcode
function custom_shortcode() {

	
	//Re-order WooCommerce Tabs - this code reorders tabs - the higher the priority(lowest number) goes first
	
	add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 );
	
	function woo_reorder_tabs( $tabs ) {
	
		$tabs['reviews']['priority'] = 5;			// Reviews first
		$tabs['description']['priority'] = 10;			// Description second
		$tabs['additional_information']['priority'] = 15;	// Additional information third
	
		return $tabs;
	}

}
add_shortcode( '', 'custom_shortcode' );

Dacă ți-a fost util acest tutorial cu ascunderea filelor de la produsele WooCommerce aștept comenatriul tău!

2.761 Vizitatori

Cât de utilă a fost această postare?

Dați click pe o stea pentru a evalua acestă postare!

Rată medie 0 / 5. Număr de voturi: 0

Nu există voturi până acum! Fii prima persoană care evaluează acestă postare.

Îmi pare rău că această postare nu a fost utilă pentru tine!

Să îmbunătățim acest postare!

Spune-mi cum pot îmbunătăți această postare?

Lasă-mi un comentariu!

Acest site folosește Akismet pentru a reduce spamul. Află cum sunt procesate datele comentariilor tale.