How to Load attribute data by attribute code in Magento 2?

We can get attribute data by attribute code by just passing attribute code in below function. We have taken entity_type_code as Catalog_Product  as a demo in below code, You can get any entity_type_code as per your requirement.

Now, Call getAttributeInfo() function from template,

The result will be like below array for color product attribute,

 

2 Replies to “How to Load attribute data by attribute code in Magento 2?”

Leave a Reply

Your email address will not be published. Required fields are marked *