I have created Product image attribute in Backend in Magento2.2.5.
Refer my screenshot
But I am not able to see in Product detail page in Admin side.
Is there any other way to do this or I am missing something.
Any help would be appreciated.
For example you have created custom image attribute.
attribute code is
attribute label is
You can upload the image in "Images And Videos" tab. Then click on the image you will see new role "Test Image" select only that. And check "Hide from Product Page".
And then if you want to display it on product page. Just to test I have placed this code in core file addtocart.pthml after this line
<?php $_product = $block->getProduct(); ?>
<img src="<?php echo $block->getBaseUrl().'pub/media/catalog/product'.$_product->getResource()->getAttribute('test_img')->getFrontend()->getValue($_product); ?>">
Now i got it , creating an attribute as Media Image , does create it as a role . You will see it when you click Add Video when editing a product in admin https://d.pr/free/i/KRUV0J .