0

I am making responsive design for mobile view. I have installed Porto Magento 2 theme. Porto theme provides css file custom design changes. I have made custom changes in custom.css file. Porto theme put custom.css file in following path. Magento 2 hosted on nginx server.

/pub/media/porto/web/css/custom.css

and custom.css file imported via below code in app/design/frontend/Smartwave/Porto/Smartwave_Porto/templates/html/head.phtml

<link rel="stylesheet" type="text/css" media="all" href="<?php echo $_helper->getPortoWebDir().'css/custom.css'; ?>">

Now the problem is if I do changes in custom.css its not refecting in my mobile. It just reflect on my PC in responsive view(sometimes I have to do hard refresh on PC to check made chages). When I checked in my mobile it's not reflect changes made in custom.css file.

Below operation I did to show reflected css changes,but no luck

I clear and flush cache

I disabled the cache and checked in my mobile but still show old changes.

I ran php bin/magento setup:static-content:deploy -f

I run index command but still in my mobile showing old css changes.

Currectly, Magento website mode is developer.

cleared generated folder

Why its not reflect on the custom.css I have an doubt. This custom.css located in /pub/media/porto/web/css/custom.css path is correct according magento 2 standard ?

Please Give me solution.I am tired of this situation.

3
  • I suggest you to not directly edit porto theme files, it will get override on theme update.create a child theme of porto, add custom CSS file and add your changes there!
    – Pawan
    Jan 24 at 14:02
  • @Pawan thanks, I created new css file in Magento_Theme module. Now my new css reflect whenever I soft refresh the page Jan 25 at 14:35
  • welcome @Niraj ..
    – Pawan
    Jan 25 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.