/ / woocomerce + storefront: agrega un campo personalizado entre ganchos / acciones en la página de inicio - woocommerce, storefront

woocomerce + storefront: agregue campos personalizados entre ganchos / acciones en la página de inicio - woocommerce, storefront

Quiero reordenar y agregar mi propio código entre acciones en la página de inicio del escaparate. Sé cómo agregar / reordenar acciones, pero no sé cómo agregar mi propio código.

function storefront_child_reorder_homepage_contant() {
remove_action("homepage", "storefront_homepage_content", 10 );
remove_action("homepage", "storefront_product_categories", 20 );
remove_action("homepage", "storefront_recent_products", 30 );
remove_action("homepage", "storefront_featured_products", 40 );
remove_action("homepage", "storefront_popular_products", 50 );
remove_action("homepage", "storefront_on_sale_products", 60 );
remove_action("homepage", "storefront_best_selling_products", 70 );
add_action("homepage", "storefront_best_selling_products", 10 );
**<--- HERE I WANT TO ADD MY OWN PHP CODE (ADVANCED CUSTOM FIELD GALLERY FIELD)**
add_action("homepage", "storefront_recent_products", 30 );
}
add_action("init", "storefront_child_reorder_homepage_contant");

Como puedes ver quiero: 1. Los productos más vendidos 2. Galería ACF 3. Productos recientes

¿Cómo agregar mi código personalizado para generar una galería entre los productos más vendidos y los más recientes?

Respuestas

1 para la respuesta № 1

Ok, lo acabo de descubrir:

function storefront_child_add_custom_php() {
PHP CODE HERE
}

function storefront_child_reorder_homepage_contant() {
remove_action("homepage", "storefront_homepage_content", 10 );
remove_action("homepage", "storefront_product_categories", 20 );
remove_action("homepage", "storefront_recent_products", 30 );
remove_action("homepage", "storefront_featured_products", 40 );
remove_action("homepage", "storefront_popular_products", 50 );
remove_action("homepage", "storefront_on_sale_products", 60 );
remove_action("homepage", "storefront_best_selling_products", 70 );
add_action("homepage", "storefront_best_selling_products", 10 );
add_action("homepage", " storefront_child_add_custom_php", 20 );
add_action("homepage", "storefront_recent_products", 30 );
}
add_action("init", "storefront_child_reorder_homepage_contant");