Magento 2 Hide top navigation links on Desktop ViewLayered navigation doesn't appear in mobile view (Magento 2)Magento 2 : Change Top Menu Alignment from Vertical to HorizontalMagento 2 call static block in the top menu navigationMagento 2 hide links in my account page conditionallyMagento2 Layout move element only for desktop view?Magento 2 : How to use Default Menu in Mobile view?Magento 2: Adding Products to Top NavigationHow to show/hide shared catalog enabled categories in layered navigation in Magento 2?How to customise category top menu navigation by custom category id in Magento 2?Magento 2 - Different menu for Mobile theme
Does the rule that you cannot willingly end your move in another creature's space force or prevent certain actions?
PhD advisor lost funding, need advice
How far did Gandalf and the Balrog drop from the bridge in Moria?
How much can I judge a company based on a phone screening?
Is it okay for a ticket seller to grab a tip in the USA?
Can the IPA represent all languages' tones?
Why aren't rockets built with truss structures inside their fuel & oxidizer tanks to increase structural strength?
What are those bumps on top of the Antonov-225?
If clocks themselves are based on light signals, wouldn't we expect the measured speed of light to always be the same constant?
Markov-chain sentence generator in Python
Are differences between uniformly distributed numbers uniformly distributed?
The cat exchanges places with a drawing of the cat
In which case does the Security misconfiguration vulnerability apply to?
Super Duper Vdd stiffening required on 555 timer, what is the best way?
Do I have to cite common CS algorithms?
Heating Margarine in Pan = loss of calories?
The cat ate your input again!
Can sampling rate be a floating point number?
Programming of ICs in general (MCU / FPGA / Serdes IC)
Why is there a large performance impact when looping over an array over 240 elements?
What was the opinion of Kumarila and Prabhakara about the Puranas?
Do beef farmed pastures net remove carbon emissions?
crippling fear of hellfire &, damnation, please help?
Why aren’t there water shutoff valves for each room?
Magento 2 Hide top navigation links on Desktop View
Layered navigation doesn't appear in mobile view (Magento 2)Magento 2 : Change Top Menu Alignment from Vertical to HorizontalMagento 2 call static block in the top menu navigationMagento 2 hide links in my account page conditionallyMagento2 Layout move element only for desktop view?Magento 2 : How to use Default Menu in Mobile view?Magento 2: Adding Products to Top NavigationHow to show/hide shared catalog enabled categories in layered navigation in Magento 2?How to customise category top menu navigation by custom category id in Magento 2?Magento 2 - Different menu for Mobile theme
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I need to hide magento 2 store top navigation menu from the desktop view but visible on mobile view. How can this be done ?
magento2 luma-theme
add a comment |
I need to hide magento 2 store top navigation menu from the desktop view but visible on mobile view. How can this be done ?
magento2 luma-theme
can you add picture of top navigation links.
– user4536
Aug 2 at 4:30
Did you resolve your issue?
– Shoaib Munir
Aug 2 at 11:59
@ShoaibMunir i have solved this issue.
– ashanr
yesterday
If your solution is different than my answer, I would suggest you add it in answer so that it would helpful for others in future
– Shoaib Munir
yesterday
add a comment |
I need to hide magento 2 store top navigation menu from the desktop view but visible on mobile view. How can this be done ?
magento2 luma-theme
I need to hide magento 2 store top navigation menu from the desktop view but visible on mobile view. How can this be done ?
magento2 luma-theme
magento2 luma-theme
asked Aug 2 at 4:22
ashanrashanr
387 bronze badges
387 bronze badges
can you add picture of top navigation links.
– user4536
Aug 2 at 4:30
Did you resolve your issue?
– Shoaib Munir
Aug 2 at 11:59
@ShoaibMunir i have solved this issue.
– ashanr
yesterday
If your solution is different than my answer, I would suggest you add it in answer so that it would helpful for others in future
– Shoaib Munir
yesterday
add a comment |
can you add picture of top navigation links.
– user4536
Aug 2 at 4:30
Did you resolve your issue?
– Shoaib Munir
Aug 2 at 11:59
@ShoaibMunir i have solved this issue.
– ashanr
yesterday
If your solution is different than my answer, I would suggest you add it in answer so that it would helpful for others in future
– Shoaib Munir
yesterday
can you add picture of top navigation links.
– user4536
Aug 2 at 4:30
can you add picture of top navigation links.
– user4536
Aug 2 at 4:30
Did you resolve your issue?
– Shoaib Munir
Aug 2 at 11:59
Did you resolve your issue?
– Shoaib Munir
Aug 2 at 11:59
@ShoaibMunir i have solved this issue.
– ashanr
yesterday
@ShoaibMunir i have solved this issue.
– ashanr
yesterday
If your solution is different than my answer, I would suggest you add it in answer so that it would helpful for others in future
– Shoaib Munir
yesterday
If your solution is different than my answer, I would suggest you add it in answer so that it would helpful for others in future
– Shoaib Munir
yesterday
add a comment |
1 Answer
1
active
oldest
votes
There are two different ways to do this.
One with CSS
Add media query and hide from desktop while display:block in mobile
.Your_Class
display:none;
@media only screen and (max-width: 600px)
.Your_Class
display:block;
The other way is by php mobile device check.
Add a helper function in any of your module
in any helper add isMobile function app/code/Vendor/Module/Helper/Data.php
<?php
namespace VendorModuleHelper;
use MagentoFrameworkAppHelperAbstractHelper;
class Data extends AbstractHelper
public function isMobile()hosin
This function will check if customer is visiting from mobile or desktop
Now use this function in your phtml like this:
<?php $isMobile = $this->helper('VendorModuleHelperData')->isMobile(); ?>
<?php if($isMobile) ?>
<?php //Call mobile menu here ?>
<?php ?>
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f284152%2fmagento-2-hide-top-navigation-links-on-desktop-view%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
There are two different ways to do this.
One with CSS
Add media query and hide from desktop while display:block in mobile
.Your_Class
display:none;
@media only screen and (max-width: 600px)
.Your_Class
display:block;
The other way is by php mobile device check.
Add a helper function in any of your module
in any helper add isMobile function app/code/Vendor/Module/Helper/Data.php
<?php
namespace VendorModuleHelper;
use MagentoFrameworkAppHelperAbstractHelper;
class Data extends AbstractHelper
public function isMobile()hosin
This function will check if customer is visiting from mobile or desktop
Now use this function in your phtml like this:
<?php $isMobile = $this->helper('VendorModuleHelperData')->isMobile(); ?>
<?php if($isMobile) ?>
<?php //Call mobile menu here ?>
<?php ?>
add a comment |
There are two different ways to do this.
One with CSS
Add media query and hide from desktop while display:block in mobile
.Your_Class
display:none;
@media only screen and (max-width: 600px)
.Your_Class
display:block;
The other way is by php mobile device check.
Add a helper function in any of your module
in any helper add isMobile function app/code/Vendor/Module/Helper/Data.php
<?php
namespace VendorModuleHelper;
use MagentoFrameworkAppHelperAbstractHelper;
class Data extends AbstractHelper
public function isMobile()hosin
This function will check if customer is visiting from mobile or desktop
Now use this function in your phtml like this:
<?php $isMobile = $this->helper('VendorModuleHelperData')->isMobile(); ?>
<?php if($isMobile) ?>
<?php //Call mobile menu here ?>
<?php ?>
add a comment |
There are two different ways to do this.
One with CSS
Add media query and hide from desktop while display:block in mobile
.Your_Class
display:none;
@media only screen and (max-width: 600px)
.Your_Class
display:block;
The other way is by php mobile device check.
Add a helper function in any of your module
in any helper add isMobile function app/code/Vendor/Module/Helper/Data.php
<?php
namespace VendorModuleHelper;
use MagentoFrameworkAppHelperAbstractHelper;
class Data extends AbstractHelper
public function isMobile()hosin
This function will check if customer is visiting from mobile or desktop
Now use this function in your phtml like this:
<?php $isMobile = $this->helper('VendorModuleHelperData')->isMobile(); ?>
<?php if($isMobile) ?>
<?php //Call mobile menu here ?>
<?php ?>
There are two different ways to do this.
One with CSS
Add media query and hide from desktop while display:block in mobile
.Your_Class
display:none;
@media only screen and (max-width: 600px)
.Your_Class
display:block;
The other way is by php mobile device check.
Add a helper function in any of your module
in any helper add isMobile function app/code/Vendor/Module/Helper/Data.php
<?php
namespace VendorModuleHelper;
use MagentoFrameworkAppHelperAbstractHelper;
class Data extends AbstractHelper
public function isMobile()hosin
This function will check if customer is visiting from mobile or desktop
Now use this function in your phtml like this:
<?php $isMobile = $this->helper('VendorModuleHelperData')->isMobile(); ?>
<?php if($isMobile) ?>
<?php //Call mobile menu here ?>
<?php ?>
answered Aug 2 at 4:29
Shoaib MunirShoaib Munir
5,7616 gold badges24 silver badges71 bronze badges
5,7616 gold badges24 silver badges71 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f284152%2fmagento-2-hide-top-navigation-links-on-desktop-view%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
can you add picture of top navigation links.
– user4536
Aug 2 at 4:30
Did you resolve your issue?
– Shoaib Munir
Aug 2 at 11:59
@ShoaibMunir i have solved this issue.
– ashanr
yesterday
If your solution is different than my answer, I would suggest you add it in answer so that it would helpful for others in future
– Shoaib Munir
yesterday