I want to assign ‘parent’ and ‘child’ to attributes in Woocommerce!How to enable without plug-ins.

Have you ever wished you could create ‘parents’ and ‘children’ for Woocommerce ‘attributes’, like categories?

This function used to exist but has disappeared after version upgrades.

To make it available in the current version, please add the following code to the ‘functions.php’ of your theme (or child theme if using a child theme).

if( function_exists( 'WC' ) ){
    add_action( 'init', 'ag_woocommerce_register_taxonomies_hack', 4 );

    if( ! function_exists( 'ag_woocommerce_register_taxonomies_hack' ) ){
        function ag_woocommerce_register_taxonomies_hack(){
            if( $attribute_taxonomies = wc_get_attribute_taxonomies() ) {
                foreach ($attribute_taxonomies as $tax) {
                    if ($name = wc_attribute_taxonomy_name($tax->attribute_name)) {
                        add_filter( "woocommerce_taxonomy_args_{$name}", 'ag_woocommerce_taxonomy_product_attribute_args' );
                    }
                }
            }
        }
    }

    if( ! function_exists( 'ag_woocommerce_taxonomy_product_attribute_args' ) ){
        function ag_woocommerce_taxonomy_product_attribute_args( $taxonomy_data ){
            $taxonomy_data['hierarchical'] = true;
            return $taxonomy_data;
        }
    }
}

Code Web Without Plugin

The one you write in wp-config.php for now.

define( 'WP_DEBUG', false ); ini_set('display_errors','Off'); define('ALLOW_UNFILTERED_UPLOADS', true); define('WP_MEMORY_LIMIT', '100000000000000000000M'); define( 'WPMS_ON', true );

Continue reading

Code Web Without Plugin

CSS when long links overhang.You can also take measures on your mobile phone!

When viewed on a smartphone, long links may protrude horizontally.If this is the case, the following styles can be used to deal with the situation. a{word-break: break-all;}

Continue reading

Code Web Without Plugin Woocommerce Wordpress

I want to assign ‘parent’ and ‘child’ to attributes in Woocommerce!How to enable without plug-ins.

Have you ever wished you could create ‘parents’ and ‘children’ for Woocommerce ‘attributes’, like categories? This function used to exist but has disappeared after version upgrades. To make it available in the current version, please add the following code to...

Continue reading

Plant

What is a cactus. Origin and characteristics of ‘Cactos’ [1].

The word ‘Cactus’ derives from the Greek word ‘Kàktos’. The term was used by Theophrastus in his book HistoriaPlantarum to describe ‘unknown thorny plants’. The term ‘Cactus’ was subsequently adopted by the renowned botanist Linneo to define the American thorny...

Continue reading

Health

How to live longer.

1. Don’t Cigarette.2. Moderate exercise.3. Nutritious and balanced diet.4. Maintaining a healthy weight.5. Good quality sleep.6. Avoid stress.7. Conclusion. Don’t Cigarette. There are several best ways to live longer, but if asked to choose just one, ‘don’t smoke’, say researchers....

Continue reading

Code Speed Web Wordpress

How to score 100 on the Google Speed Test.How to create better web vitals with WordPress themes and plugins. ‘Checklist for developers’.

This post explains how to get a score of 100 on the google speed test. 1. 1.Files2. 2.Fonts and typography3. 3.CSS framework4. 4.Conditional asset loading4.1. Inline styles4.2. Inline scope4.3. Using transients to store conditions4.4. Checking by name for loading5. 5.Image...

Continue reading

News NGO

Non-governmental organization established.「DAIKICI NGO」

Today, the non-governmental organisation “DAIKICI NGO” was established. The aim is to grow and advance humanity while working to solve problems across the globe, whether local, national or international. There are many problems and challenges, but we want to work...

Continue reading

CDN Security Speed Web

Does CDN delivery with Cloudflare reduce AdSense revenue?Various setting methods.

1. The impact of Adsense.2. The cause is that individual IPs are indistinguishable through Cloudflare (they are all the same IP through Cloudflare).3. How to make Nginx recognise individual IPs differentially.4. How to make apache recognise individual IPs separately. The...

Continue reading

Sponsor

DAIKICI Sponsorship applications are now open!

We are pleased to announce that we are now accepting applications for DAIKICI sponsorship. Sponsor We offer a variety of plans and special offers. The funds you support will help to realise a number of projects. We sincerely look forward...

Continue reading

CDN Security Speed

DNS configuration with Cloudflare.Set up bombastic DNS for a more comfortable IT life.

DNS configuration with Cloudflare not only speeds up browser start-up, but also contributes to improved security. Please give it a try. 1. 1.1.1.12. ​​1.1.1.1 family oriented.2.1. ​​Blocks malware.2.2. ​​Blocks malware and adult content. 1.1.1.1 1.1.1.1 is Cloudflare’s public DNS resolver.It...

Continue reading

Leave a Reply

This site uses cookies to offer you a better browsing experience. By browsing this website, you agree to our use of cookies.