{"id":1581,"date":"2014-02-28T21:03:43","date_gmt":"2014-02-28T21:03:43","guid":{"rendered":"http:\/\/musilda.cz\/?p=1581"},"modified":"2014-02-28T21:03:43","modified_gmt":"2014-02-28T21:03:43","slug":"jak-zmenit-pocet-sloupcu-ve-vypisu-produktu-woocommerce","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/jak-zmenit-pocet-sloupcu-ve-vypisu-produktu-woocommerce\/","title":{"rendered":"Jak zm\u011bnit po\u010det sloupc\u016f ve v\u00fdpisu produkt\u016f Woocommerce"},"content":{"rendered":"\n
Jeden z jednodu\u0161\u0161\u00edch kousk\u016f k\u00f3du pro Woocommerce, kter\u00fd v\u00e1m pom\u016f\u017ee upravit po\u010det produkt\u016f v jednom \u0159\u00e1dku. Pokud pot\u0159ebujete zm\u011bnit \u010dty\u0159i sloupce na t\u0159i, sta\u010d\u00ed pou\u017e\u00edt filter loop_shop_columns. <\/p>\n\n\n\n\n\n\n\n
V souboru content-product.php ve slo\u017ece plugins\/woocommerce\/templates najdete na \u0159\u00e1dku 22<\/p>\n\n\n\n
$woocommerce_loop['columns'] = apply_filters( 'loop_shop_columns', 4 );<\/pre>\n\n\n\nA p\u0159esn\u011b ten filter ovlivn\u00edme n\u00e1sleduj\u00edc\u00edm k\u00f3dem<\/p>\n\n\n\n
add_filter('loop_shop_columns', 'my_loop_columns');\nif (!function_exists('my_loop_columns')) {\n\tfunction my_loop_columns() {\n\t\treturn 3;\n\t}\n}\n<\/pre>\n\n\n\nDopln\u011bn\u00ed:<\/p>\n\n\n\n
Ur\u010dit\u011b budete pot\u0159ebovat upravit i po\u010det produkt\u016f na str\u00e1nku, co\u017e ud\u011bl\u00e1te p\u0159id\u00e1n\u00edm n\u00e1sleduj\u00edc\u00edho k\u00f3du do functions.php<\/p>\n\n\n\n
add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 21;' ), 20 );\n<\/pre>\n\n\n\n