2017-11-01 7 views
0

상점 정면 홈페이지의 작업간에 직접 코드를 추가하고 추가하고 싶습니다. 추가/순서 재 지정하는 방법을 알고 있지만 내 자신의 코드를 추가하는 방법을 모르겠습니다.woocomerce + storefront - 홈페이지에서 후크/액션 사이에 맞춤 입력란 추가

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'); 

당신은 내가 원하는 볼 수 있듯이 : 1. 베스트셀러 제품 2. ACF 갤러리 3. 최근 제품

어떻게 베스트셀러 최근 제품 간의 갤러리를 생성하는 내 사용자 지정 코드를 추가하는

?

답변

1

가 좋아 난 그냥 그것을 알아 냈어요 :

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');