{"id":400,"date":"2015-04-14T12:04:43","date_gmt":"2015-04-14T11:04:43","guid":{"rendered":"http:\/\/dknzdesign.com\/?p=400"},"modified":"2015-04-23T12:01:32","modified_gmt":"2015-04-23T11:01:32","slug":"how-to-display-category-name-in-a-custom-product-list-on-homepage","status":"publish","type":"post","link":"https:\/\/dknzdesign.com\/sl\/blog\/magento\/how-to-display-category-name-in-a-custom-product-list-on-homepage\/","title":{"rendered":"Kako prikazati ime kategorije na seznamu izdelkov po meri na doma\u010di strani?"},"content":{"rendered":"<p>Generally on magento store we see the products list of some category on home page. To implement that, we use list.phtml file or any custom file to show any category product list on home page using following block:<\/p>\n<pre><code>{{block type=\"catalog\/product_list\" category_id=\"3\" template=\"catalog\/product\/list.phtml\"}}<\/code><\/pre>\n<p>This block only shows products list on home page, but it doesn\u2019t show the category name.<br \/>\nTo show category name with that products list, we need to add following code into list.phtml or any custom file which you are using.<\/p>\n<p>1. Go to app\/design\/frontend\/your_package\/your_theme\/template\/catalog\/product and open list.phtml then add the following code :<\/p>\n<pre><code>&lt;?php echo Mage::getModel('catalog\/category')-&gt;load($this-&gt;getCategoryId())-&gt;getName(); ?&gt;<\/code><\/pre>\n<p>2. Now refresh your store home page, it should show the category name on the home page.<\/p>","protected":false},"excerpt":{"rendered":"<p>Generally on magento store we see the products list of some category on home page. To implement that, we use list.phtml file or any custom file to show any category product list on home page using following block: {{block type=&#8221;catalog\/product_list&#8221; category_id=&#8221;3&#8243; template=&#8221;catalog\/product\/list.phtml&#8221;}} This block only shows products list on home page, but it doesn\u2019t show&#8230;<\/p>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40],"tags":[102,43,103],"class_list":["post-400","post","type-post","status-publish","format-standard","hentry","category-magento","tag-homepage","tag-magento","tag-products"],"_links":{"self":[{"href":"https:\/\/dknzdesign.com\/sl\/wp-json\/wp\/v2\/posts\/400","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dknzdesign.com\/sl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dknzdesign.com\/sl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dknzdesign.com\/sl\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dknzdesign.com\/sl\/wp-json\/wp\/v2\/comments?post=400"}],"version-history":[{"count":3,"href":"https:\/\/dknzdesign.com\/sl\/wp-json\/wp\/v2\/posts\/400\/revisions"}],"predecessor-version":[{"id":403,"href":"https:\/\/dknzdesign.com\/sl\/wp-json\/wp\/v2\/posts\/400\/revisions\/403"}],"wp:attachment":[{"href":"https:\/\/dknzdesign.com\/sl\/wp-json\/wp\/v2\/media?parent=400"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dknzdesign.com\/sl\/wp-json\/wp\/v2\/categories?post=400"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dknzdesign.com\/sl\/wp-json\/wp\/v2\/tags?post=400"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}