{"id":55160,"date":"2022-01-25T20:09:38","date_gmt":"2022-01-25T19:09:38","guid":{"rendered":"https:\/\/samuelchopard.ch\/wiki\/?p=55160"},"modified":"2022-01-25T20:10:42","modified_gmt":"2022-01-25T19:10:42","slug":"change-number-of-products-and-categories-per-row-in-shop-archives","status":"publish","type":"post","link":"https:\/\/samuelchopard.ch\/wiki\/library\/change-number-of-products-and-categories-per-row-in-shop-archives\/","title":{"rendered":"Change number of products and categories per row in shop archives"},"content":{"rendered":"<p><!--more--><br \/>\nPaste the following code in <em>functions.php<\/em> and change values as needed:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">\/* Change number of products and categories per row in shop archives *\/\r\nadd_filter('loop_shop_columns', 'loop_columns');\r\nif (!function_exists('loop_columns')) {\r\n    function loop_columns() {\r\n        if ( is_product_category() ) {\r\n            return 3; \/* &lt;- number of products per row *\/\r\n        } else {\r\n            return 4; \/* &lt;- number of categories per row *\/\r\n        }\r\n    }\r\n}<\/pre>\n<p>Source: <a target=\"_blank\" href=\"https:\/\/stackoverflow.com\/questions\/38932094\/how-to-change-the-number-of-product-categories-per-row-using-woocommerce\">https:\/\/stackoverflow.com\/questions\/38932094\/how-to-change-the-number-of-product-categories-per-row-using-woocommerce<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"Paste the following code in functions.php and change values as needed: \/* Change number of products and categories per row [...]","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[399,400,234,267],"class_list":["post-55160","post","type-post","status-publish","format-standard","hentry","category-woocommerce","tag-archives","tag-categories","tag-products","tag-shop"],"_links":{"self":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/55160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/comments?post=55160"}],"version-history":[{"count":2,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/55160\/revisions"}],"predecessor-version":[{"id":55163,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/55160\/revisions\/55163"}],"wp:attachment":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/media?parent=55160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/categories?post=55160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/tags?post=55160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}