Tech Support Forum banner
1 - 4 of 4 Posts

· Registered
Joined
·
39 Posts
Discussion Starter · #1 ·
hi eveyone,

recently, I installed a ready-made wordpress theme on my webserver. this is the link to the website


the issue is with the "Home" menu tab. it works really fine on PC web browser. However, in the responsive mobile mode, when I click the "Home" parent menu (the "Home parent menu is also a link to the homepage by the way) the menu does not give me the chance to choose from the dropdown menu, it always ignores the dropdown menu and leads me to the home page link. What I need is for "Home" parent link menu to be ignored on first click showing the submenu to choose from them, and then if "Home" is clicked for a second time it will navigate to its URL which is the homepage. I would like to avoid plugins. if there is another way through the WordPress admin panel, or if there is a way by inserting some code somewhere, I'll be grateful for the help. since my knowledge in web development coding is very limited, I will be thankful if the code is given with instructions on which file should I place the code in and how to reach that file. I don't need the same action with the other menu tabs because the other parent menu tabs are not links unlike "Home" menu tab. Thanks in advance for everyone.
 

· Registered
Joined
·
2 Posts
Check if the following works for you.


Step 1: Backup your website
Before making any changes to your website's code, it is important to take a backup of your website. This will ensure that you can restore your website in case anything goes wrong during the process.

Step 2: Access your WordPress theme files
You will need to access your WordPress theme files to add the necessary code. You can access your theme files through the WordPress admin panel by going to Appearance > Theme Editor.

Step 3: Locate the header.php file
The header.php file is the file that contains the code for your website's header, which includes the navigation menu. You will need to add the custom code to this file.

Step 4: Add the custom code
Open the header.php file and locate the code for the "Home" menu item. You will need to add some custom code to this section of the file.


Here's the code you can use:



Note: Replace "XXX" with the ID of the "Home" menu item. You can find this by inspecting the element in your browser and looking for the menu item's ID.

Step 5: Save and test
Save the changes to the header.php file and test the functionality of the "Home" menu item in mobile view. It should now display the dropdown menu on the first click and navigate to the homepage on the second click.


Edit: Sorry buddy. I dont know whats wrong but I am unable to post the code. Something wrong with forum reply
 

· Registered
Joined
·
39 Posts
Discussion Starter · #3 ·
Thanks a lot for your reply and for your help. I really appreciate it. If the code attachment does not work can you please post the code as normal text. thank you again for your help
 
1 - 4 of 4 Posts
Top