Jump to content

Best Way To Customize The Nav Classic Section?

Recommended Posts


I have a very small change to make: changing the main_nav class to main_nav_anythingelse. The existing name is adding residual styling to Ubermenu and causing it to scale improperly when the window gets narrow (smartphone), so it needs to be changed.

I'm already using a child theme (Base Theme), so I assume that the altered code goes somewhere there, but I'm not sure where, or if there's a better way to do it.

I should also say, that when I alter it right in the nav/section.php file, it does what I want it to do, but I obviously don't want to be making that change right in the theme files.



Share this post

Link to post
Share on other sites

If you're working with the menu, you'd need to add the section.php file for the nav to the base theme and edit the file there.

Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post

Link to post
Share on other sites

Thanks, Catrina. I'm a bit unsure how to do that. Are there instructions you could point me to?

Do I copy the whole nav section folder to the base theme sections folder or just the php file? Or are you talking about copying the section.php into something else?



Share this post

Link to post
Share on other sites

aremesia66 -

There are a couple ways you can do it.

For simple modifications, you can create a template.SECTIONNAME.php (where SECTIONNAME is the folder name of the section) file in the root of your child theme. This file will override the section_template of the section's class.

This is a quick and handy way to override section output that also allows you access to the section class's properties and methods.

Or like Catrina said, you can copy the section's section.php file into your child theme like this: childthemeroot/sections/sectionfoldername/section.php. This will override the section's section.php file (if you need to customize more there than just the template) with your customized one, but still load all the other section files like LESS/CSS or other images.

For more advanced modifications, you can just copy the whole section from core, into your child theme's sections folder. If you leave the core section you are copying activated, it will load that section's LESS/CSS even when you are overriding it with your section, so assuming you have the pagelines sections plugin installed, you can go into the Store under Pagelines, go to sections, and disable it under core so that just your custom one is activated. Then you can customize it however you want! Turn it into something totally new if you want.

Hope that helps!

Share this post

Link to post
Share on other sites

Thanks to both of you. I ended up using the second method from Evan's list. For some reason, using the template.nav.php threw an error.--most likely me understanding just enough php to be dangerous. In any case, I now understand the principals better as well as solving my problem.

Share this post

Link to post
Share on other sites

The topic was marked as resolved.

Mackenzie - PageLines Help Desk

The Centsible Family - Writer, Photographer and Coffee Addict


Kindly search this forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • Liv Kundalini
      By Liv Kundalini+
      Hi -
      Pulling my hair out over here, and would love an assist!
      Site I am building, http://www.livkundalini.com/home, has a problem with the submenu items in the nav not appearing. 
      If anyone wants to see what the Nav should look like, feel free to look in the footer on the left hand side.
      Have tried disabling Pagelines and using the twentyseventeen theme, but problem persists.
      Saw this error (pasted at the bottom of this post) displaying in the inspector, and saw discussion of Jetpack potentially being a culprit. Disabled Jetpack, but the problem persists.
      Had the hosting company even flush the server-side cache, but no avail.
      Any thoughts? Please? It's the only thing keeping me from launching this site!
      Many Thanks,
      WebSocket connection to 'wss://public-api.wordpress.com/pinghub/wpcom/me/newest-note-data' failed: Error during WebSocket handshake: Unexpected response code: 403   O @ (index):7
    • russe-intensif
      By russe-intensif+
      Hi team,
      checking my site today, i'm surprised to see my MegaNav all in bottom of the pages, while it's in header.
      After getting to change it in couple of pages onto Template part (too time consuming !), i'm desperate and ask you for help :-)
      Thank you in advance !

    • Borries
      By Borries+
      I know this is not an easy problem. Maybe there is a easy solution.
      I have tryed to uses the existing solution, that I have found in the forum
      I changed the colours of my nav (simple nav) and the hover effect (a. hover).
      I really tryed to highlight the active/used link in the nav but I cant figure it out.
      I want it to be black when active.
      Any help would be appreciated. Thanks.
      http://www.marcborries.de  nav link: "Sinn & Selbst" 
    • Dan Haddock
      By Dan Haddock
      Hi Pagelines team and wider community,
      I am looking to develop a single post page for my blog. I have read over an old article on the subject, however the link provided on achieving this goal was giving me security warnings. Is there any way I can get round this?
      Secondly, I have had a root around the .zip file provided on my sites backup, however was unable to locate any file in there with the name of Single.php. Does this file exist in the Pagelines theme?
      By the way, this is the unsafe article: http://support.pagelines.me/docs/customization/create-a-custom-page-template/ (Click at your peril).
    • dwpoyner
      By dwpoyner+
      Not sure exactly what is causing the issue. For some reason, why you view my site on mobile, the menu does not show up. It will pop up, but it is black. You can check it out here: http://dev.caryfbc.org. I'm also attaching a screenshot where I shrunk my browser down. Any suggestions?