{"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\n

A 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\n

Dopln\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

Dal\u0161\u00ed u\u017eite\u010dn\u00e9 snippety najdete na str\u00e1nce U\u017eite\u010dn\u00e9 snippety pro WooCommerce<\/a><\/strong> <\/p>\n","protected":false},"excerpt":{"rendered":"

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","protected":false},"author":1,"featured_media":8732,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,25,29],"tags":[425],"class_list":["post-1581","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-snippety","category-woocommerce","category-woocommerce-snippety","tag-woocommerce"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/1581"}],"collection":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/comments?post=1581"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/1581\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/8732"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=1581"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=1581"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=1581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}