{"id":2298570,"date":"2011-09-15T03:59:14","date_gmt":"2011-09-15T03:59:14","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/categories-products\/"},"modified":"2016-08-20T02:27:26","modified_gmt":"2016-08-20T02:27:26","slug":"categories-products","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/categories-products\/","title":{"rendered":"categories &gt; products"},"content":{"rendered":"<p>Hey, so I need some advice on this php I&#8217;m trying to use on a products page. (I&#8217;m new to this)<\/p>\n<p>I&#8217;ve written this so far&#8230;<\/p>\n<pre><code>&lt;?php\n$productCats = get_categories(\u00a0&#039;child_of&#039; =&gt; 3\u00a0); \/\/the ID of the parent category\nforeach($productCats as $productCat) {\n\techo\t&#039;&lt;article class=&quot;item&quot;&gt;\n\t\t\t&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;#&quot; alt=&quot; &quot; \/&gt;\n\t\t\t&lt;h2&gt;&#039; . $category-&gt;name . &#039;&lt;\/h2&gt;&lt;\/a&gt;\n\t\t\t&lt;p&gt;&#039; . $category-&gt;description . &#039;&lt;\/p&gt;\n\t\t&lt;\/article&gt;&#039; ;\n} ?&gt;<\/code><\/pre>\n<p>I have specific pages for each instance of $productCat to link to. How should I go about doing that?<\/p>\n<p>I was thinking there might be a way to utilize the <strong>Order<\/strong> Page Attribute in some way?<\/p>\n<p>Thanks in advance!<\/p>\n","protected":false},"template":"","class_list":["post-2298570","topic","type-topic","status-closed","hentry","topic-tag-categories"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2298570","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2298570\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=2298570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}