{"id":2611,"date":"2015-12-12T19:56:59","date_gmt":"2015-12-12T19:56:59","guid":{"rendered":"http:\/\/musilda.cz\/?p=2611"},"modified":"2015-12-12T19:56:59","modified_gmt":"2015-12-12T19:56:59","slug":"jak-odstranit-drobeckovou-navigaci-ve-woocommerce","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/jak-odstranit-drobeckovou-navigaci-ve-woocommerce\/","title":{"rendered":"Jak odstranit drobe\u010dkovou navigaci ve WooCommerce"},"content":{"rendered":"
WooCommerce v z\u00e1kladn\u00edm nastaven\u00ed zobrazuje drobe\u010dkovou navigaci. Proto\u017ee je ob\u010das nezbytn\u00e9, navigaci odstranit, uk\u00e1\u017eeme si, jak na to.<\/p>\n
\u0158e\u0161en\u00ed je jednoduch\u00e9, ale nejprve si mus\u00edme \u0159\u00edci, jak je navigace v \u0161ablon\u00e1ch zobrazov\u00e1na.<\/p>\n
Pokud si otev\u0159ete nap\u0159\u00edklad soubor archive-product.php, kter\u00fd najdete v plugins\/woocommerce\/templates, najdete na \u0159\u00e1dku 25, tento z\u00e1pis:<\/p>\n
do_action( ‚woocommerce_before_main_content‘ );<\/p>\n
Tento hook, obsahuje zav\u011b\u0161en\u00e9 dv\u011b funkce, a jedna z nich je\u00a0woocommerce_breadcrumb.<\/p>\n
Jak je vid\u011bt, nenajdete nikde v \u0161ablon\u011b konkr\u00e9tn\u00ed funkci, ta je um\u00edst\u011bna jinde. M\u016f\u017eete sice smazat cel\u00fd hook, ale t\u00edm odstran\u00edte i div, kter\u00fd je um\u00edst\u011bn, pomoc\u00ed\u00a0woocommerce_output_content_wrapper, ve stejn\u00e9m hooku.<\/p>\n
Proto mus\u00edme drobe\u010dkovou navigaci, z hooku odstranit.<\/p>\n
Do functions.php pak sta\u010d\u00ed zapsat:<\/p>\n
add_action( 'init', 'musilda_remove_wc_breadcrumbs' );\nfunction musilda_remove_wc_breadcrumbs() {\n remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );\n}\n<\/pre>\nNic v\u00edce nepot\u0159ebujete.<\/p>\n\n\n