이 플러그인은 최근 3개의 주요 워드프레스 출시와 시험 되지 않았습니다. 워드프레스의 좀 더 최근 버전으로 이용할 때 더 이상 관리되지 않고 지원되지 않고 호환성 문제가 있을 수 있습니다.

Hide Categories On Shop Page

설명

This free WooCommerce extension permits you to hide categories on your shops main page.
For this you have to save the categories with ‘,’ seperated in woocommerce > settings > products tab section.

In order for this to work you have to have Categories displayed. This can be set via Customizer. Appearance > Customize > WooCommerce > Product Catalog.

“Choose what to display on the main shop page.” Select Show categories as seen in the Screenshot below.

Additional Information

For users who has a different/custom page for their shop you can edit the wc-hide-categories.php file
Find line # 127 and remove //

//$mwd_opt4 = in_array( 'product_cat', $taxonomies ) && ! is_admin() && is_page('YOUR_PAGE_SLUG'),

Then find line #129 /*|| $mwd_opt4*/

Change to
|| $mwd_opt4

To remove products from those categories find line 160

// Uncomment the function below if you also want those products hidden
/*
    add_action( 'woocommerce_product_query', 'mwd_hwcosp_remove_product_in_cat' );

    function mwd_hwcosp_remove_product_in_cat( $q ) {
        //hwcosp_global is the databse row entry
        $opt_terms = get_option('hwcosp_global');

        // Processes our users data to the way we want it from above
        $data = mwd_hwcosp_comma_separated_to_array($opt_terms);

        $tax_query = (array) $q->get('tax_query');
        $tax_query[] = array(
                             'taxonomy' => 'product_cat',
                             'field' => 'slug',
                             'terms' => $data, // Set Category Slug which products not show on the shop and Archieve page.
                             'operator' => 'NOT IN'
                            );
        $q->set( 'tax_query', $tax_query );
    }
*/

The code is well documented so its easy to find what part you are looking for

If you have any question please ask in the support forum, Thanks

설치

  • Upload ‘wc-hide-categories.zip’ like any other plugin or upload the zip file contents to the ‘/wp-content/plugins/’ directory
  • Activate the plugin through the ‘Plugins’ menu in WordPress
  • Configure the plugin at Dashboard > WooCommerce > Settings > Products > Hide Categories On Shop Page
  • Save your settings with the category slugs with ‘,’ seperated.
  • I.E. cat1, cat2, cat3

FAQ

Does this work on Multisite?

As of version 1.1.0 Yes

I’d like to donate, how can I?

Click the donate button to the right or go here https://www.paypal.me/matrixwd
And thank you in advance 🙂

후기

2022년 9월 3일
I can see there are 2 people they told the plugin isn't working. But they are wrong. It's working properly. If you want to work with this plugin then you have to go to woocommerce >> setting >> product >> Hide Categories On Shop Page and then in this box first type eg : (prnt.sc/Y-vk69VlUXkD) then copy your category slug and pest in the box. Save changes and clear your site cache. And your age good to go. A very good plugin for removing categories on a single product page. Hope the above instruction will help new users. Thanks
2021년 5월 3일 3 replies
Not only doesn't this plugin work right. It throws PHP warnings and fills the error log. At this point, this plugin hasn't been updated in over a year.
모든 13 평가 읽기

기여자 & 개발자

“Hide Categories On Shop Page”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에 기여하였습니다.

기여자

자국어로 “Hide Categories On Shop Page”(을)를 번역하세요.

개발에 관심이 있으십니까?

코드 탐색하기는, SVN 저장소를 확인하시거나, 개발 기록RSS로 구독하세요.

변경이력

1.1.3

  • Added missing line if foreach loop and fixed versioning numbers

1.1.2

  • Updated Foreach() that was causing a PHP warning: Attempt to read property “slug” on int … line 147

1.1.1

  • Updated Readme

1.1.0

  • Updated so that it now works on WordPress Multisites
  • Added new comments to the code so its easier to follow on what block does what
  • Added the ability to hide sub categories
  • Added the ability to hide all products under root category and sub category

1.0.1

  • Added the conditionals to test if the shop is_home() or is_front_page() and added the a fourth test a user could uncomment to add their custom shop page slug.

1.0

  • Stable initial release