Jump to content
Sign in to follow this  
davidcsonka

How to add custom code to platform top navbar area

Recommended Posts

davidcsonka

At the top of the blog template there is the navbar section which includes Wordpress specified menu links, and the Platform pro enabled search box. I would like to add another item in there using custom code, which would not be doable as a menu item. Is there a hook or specific template I would edit to do this? Example website: http://naturallyengineered.com/blog/ Thanks!

Share this post


Link to post
Share on other sites
davidcsonka

Cool, I think I'll probably be able to make it work somehow. I see that there is a php code for the search box: <?php get_search_form();?> Is there a list of all of these somewhere? I'll need to call the navbar menu items as well it seems, and will have to rebuild the top navbar from scratch to accommodate what I want to do.

Share this post


Link to post
Share on other sites
davidcsonka

Hmm well I found the wp_nav_menu() function in the WP codex. But I can't find any way in the PageLines settings to disable showing menu links or page links in the top nav bar section. You can disable showing the search form, but I don't see an option to disable showing the menu links.

Share this post


Link to post
Share on other sites
davidcsonka

So, I assume that somewhere in the template files wp_list_pages(); is being run to show the blog pages when no menu is assigned for the nav bar. I can't find the file in the theme where this function is being run. I need to be able to manually reinsert a menu, so that I can have it line up with the other stuff I'm putting into the navbar. Basically, I need the navbar section to be action, but have nothing in it, so I can manually add all the stuff back in (menu, search form, etc) with a hook so I can arrange the stuff the way I need.

Share this post


Link to post
Share on other sites
cmunns

You want a nav that doesn't do anything? I'm confused. If you want to reference the menu it's in the sections folder under nav- section.nav.php

Share this post


Link to post
Share on other sites
davidcsonka

I want to rearrange the position of elements that go into the nav section (menu and search form), and add a new one (specifically the Google Translate widget). Apparently the only way I can do that is if I tell Platform to not display them automatically, and then manually plug them back in at the positions I want them at.

Share this post


Link to post
Share on other sites
davidcsonka

If there is a better way to do that, I'm all ears! :D I found the file you mentioned section.nav.php, but it is not in base, so I guess I would have to hack the Platform theme to make it work. :/

Share this post


Link to post
Share on other sites
Andrew

You can override the section template with by adding: `template.nav.php` to the root of the child theme. Just copy the code and get started.

Share this post


Link to post
Share on other sites
davidcsonka

Ahh, Andrew, so I can copy the entire file "template.nav.php" from the Platform into the files for Base, and it will override the default Platform theme code? I can then edit the file, removing the code for the menu stuff - plug it in back manually with hooks?

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

Sign in to follow this  

×