وردپرس

Extra Unwanted product-related sections on homepage Pt2


Another post was very helpful, but was incomplete and closed. Here’s part 2.

You are using the Storefront theme. Your home page has a bunch of unwanted categories at the bottom, and you want them gone. Categories such as:

new in, we recommend, best sellers, fan favorites, etc.

Locate the functions.php file for the theme, edit it, and add this code to the very bottom of the file:

/* Remove unwated items at bottom of homepage*/
function storefront_child_enqueue_styles() {
wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );
}
function remove_storefront_home_sections( $args ) {
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 );
remove_action( ‘homepage’, ‘storefront_promoted_products’, 80 );
}
add_action( ‘after_setup_theme’, ‘remove_storefront_home_sections’ );

  • This topic was modified 5 minutes ago by odingalt.
  • This topic was modified 1 minute ago by odingalt.

این خبر را در ایران وب سازان مرجع وب و فناوری دنبال کنید

مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد

منبع: انجمن وردپرس

دکمه بازگشت به بالا