{"id":182,"date":"2016-08-27T01:12:12","date_gmt":"2016-08-27T01:12:12","guid":{"rendered":"https:\/\/wiki.samuelchopard.ch\/?p=182"},"modified":"2019-03-18T14:29:27","modified_gmt":"2019-03-18T13:29:27","slug":"change-number-of-products-per-row","status":"publish","type":"post","link":"https:\/\/samuelchopard.ch\/wiki\/library\/change-number-of-products-per-row\/","title":{"rendered":"Change number of products per row"},"content":{"rendered":"<p><!--more--><\/p>\n<h3>Custom theme<\/h3>\n<p>If you\u2019re building a custom theme it may be useful to make this pluggable for other developers<\/p>\n<pre class=\"EnlighterJSRAW\">\/\/ Change number or products per row to 3\nadd_filter('loop_shop_columns', 'loop_columns');\nif (!function_exists('loop_columns')) {\n     function loop_columns() {\n          return 3; \/\/ 3 products per row\n     }\n}<\/pre>\n<p>&nbsp;<\/p>\n<h3>WooTheme<\/h3>\n<p>If you\u2019re using a WooTheme then this code may have been utilised in the theme. It will already be pluggable which means you\u2019ll need to redefine the function in your functions.php file (preferably in a child theme) to overwrite the theme default.<\/p>\n<pre class=\"EnlighterJSRAW\">\/\/ Override theme default specification for product # per row\nfunction loop_columns() {\nreturn 5; \/\/ 5 products per row\n}\nadd_filter('loop_shop_columns', 'loop_columns', 999);<\/pre>\n<p>&nbsp;<br \/>\nSource: <a target=\"_blank\" href=\"https:\/\/docs.woocommerce.com\/document\/change-number-of-products-per-row\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/docs.woocommerce.com\/document\/change-number-of-products-per-row\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"Custom theme If you\u2019re building a custom theme it may be useful to make this pluggable for other developers \/\/ [...]","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,8],"tags":[86,91,234,253],"class_list":["post-182","post","type-post","status-publish","format-standard","hentry","category-plugins","category-woocommerce","tag-display","tag-e-commerce","tag-products","tag-row"],"_links":{"self":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/182","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=182"}],"version-history":[{"count":1,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/182\/revisions"}],"predecessor-version":[{"id":54929,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/182\/revisions\/54929"}],"wp:attachment":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/media?parent=182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/categories?post=182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/tags?post=182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}