Selezione categorie in home page

  • Avatar di Sconosciuto

    Buongiorno,
    sul mio sito, in home page, la prima sezione “Acquista per categoria” presenta 4 categorie (Accessori, bambino 2/16 anni, speciale Natale, bambina 2/16).
    Vorrei capire dove devo agire per:
    – poter scegliere quali categorie vengono mostrate
    – aggiungere una quinta categoria visualizzata

    Grazie in anticipo per l’aiuto.

  • Avatar di Sconosciuto

    Ho risolto solo parzialmente (ora vedo la quinta categoria) modificando questa parte di codice

    function storefront_product_categories( $args ) {
    
    		if ( storefront_is_woocommerce_activated() ) {
    
    			$args = apply_filters( 'storefront_product_categories_args', array(
    				'limit' 			=> 4,
    				'columns' 		=> 4,
    				'child_categories' 	=> 0,
    				'orderby' 			=> 'name',
    				'title'				=> __( 'Acquista per categoria', 'storefront' ),
    			) );
    
    			$shortcode_content = storefront_do_shortcode( 'product_categories', apply_filters( 'storefront_product_categories_shortcode_args', array(
    				'number'  => intval( $args['limit'] ),
    				'columns' => intval( $args['columns'] ),
    				'orderby' => esc_attr( $args['orderby'] ),
    				'parent'  => esc_attr( $args['child_categories'] ),
    			) ) );

    in

    function storefront_product_categories( $args ) {
    
    		if ( storefront_is_woocommerce_activated() ) {
    
    			$args = apply_filters( 'storefront_product_categories_args', array(
    				'limit' 			=> <strong>5</strong>,
    				'columns' 			=> <strong>5</strong>,
    				'child_categories' 	=> 0,
    				'orderby' 			=> 'name',
    				'title'				=> __( 'Acquista per categoria', 'storefront' ),
    			) );
    
    			$shortcode_content = storefront_do_shortcode( 'product_categories', apply_filters( 'storefront_product_categories_shortcode_args', array(
    				'number'  => intval( $args['limit'] ),
    				'columns' => intval( $args['columns'] ),
    				'orderby' => esc_attr( $args['orderby'] ),
    				'parent'  => esc_attr( $args['child_categories'] ),
    			) ) );

    contenuta nel file storefront-child/inc/storefront-template-functions.php

    Ora mi rimane solo da capire come posso “scegliere” le categorie che devono stare in home page a mio piacimento. Ora come ora c’è “order by name”…

    Grazie a chi mi aiuterà!

  • L'argomento ‘Selezione categorie in home page’ è chiuso a nuove risposte.