Jump to content
Sign in to follow this  
kinek

Need to edit section.nav.php

Recommended Posts

kinek

Need help. I am trying to add a sign up button to the section.nav.php file and I know this is the wrong place to put it since it will get overwritten with platformpro updates. I tried copying the file to platformbase but that doesn't seem to work. I can get the sign up button to work perfectly in this file but I am more worried about it going missing if we do a theme update in the future. How can I add the below code to functions.php or a copy of section.nav.php to platformbase so I can ensure this is dealt with properly for updates. function section_template() { global $post; ?>

sign_up.png
<?php if(function_exists('wp_nav_menu')){ wp_nav_menu( array('menu_class' => 'main-nav'.pagelines_nav_classes(), 'container' => null, 'container_class' => '', 'depth' => 3, 'theme_location'=>'primary', 'fallback_cb'=>'pagelines_nav_fallback') ); }else{ pagelines_nav_fallback(); } if(!pagelines_option('hidesearch')){ get_search_form(); } ?>

Share this post


Link to post
Share on other sites
Rob
That's a Hook and goes in /wp-content/themes/platformbase/functions.php when you have Platformbase activated as your theme. Please see http://www.pagelines.com/docs for information on hooks and resources to get just the right hook. I don't think function section_template() { global $post; ?> is the correct hook to use, but not sure where you want to place this hook. Will it go in a sidebar, main content area, header or footer?

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
kinek
Hi there, This is in the section.nav.php file so it goes in the Navigation. I've tried inserting it in the functions.php file in my platformbase theme, which is activated. I am trying to get this in platformbase since section.nav.php just getting overwritten in platformpro with updates. Any help on how to add this to platformbase/functions.php would be greatful.

Share this post


Link to post
Share on other sites
Rob
Try the instructions here to copy section.nav.php over to base from pro. It might work. That would prevent it from being overwritten. http://www.pagelines.com/docs/custom-sections

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
kinek
With the link you provided the "Overriding Section Templates" is exactly what I need, but it doesn't work for the [b]section.nav.php[/b] file, no matter where I put it. I've tried putting it in the root of Platformbase, in the sections folder, and even tried creating a "nav" folder within the sections folder and placed it in there, since that is where it is location in PlatformPro. Nothing works. All the template.[sectionId].php files work with this method, but the [b]section.nav.php[/b] does not. Someone from Pagelines that knows how to do this please respond as there is no documentation anywhere on how to specifically do this.

Share this post


Link to post
Share on other sites
Danny
Hi, Editing the core files like you say is not wise and we can not provide support if you edit these files. If you wish to a sign up button, can you tell us where exactly you want this button please, providing a concept image would be most helpful.

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
kinek
Take a look at [url="www.kinek.com"]www.kinek.com[/url], and notice where the Sign Up button is in the top right of the page. If I place this in the template.branding.php file the navigation elements are on top of the Sign Up button and its not clickable. That is why I put it in the section.nav.php section to replace where the search form goes. Is there no way to put the section.nav.php into Platformbase and edit it there? Any suggestions are helpful.

Share this post


Link to post
Share on other sites
beardedavenger
If you are trying to add something, to a section, then use a hook, as Robert suggested. This is the preferred, professional, and recommended way of adding a specific object, to a specific place on your site. Please see http://www.pagelines.com/docs for information on hooks and resources to get just the right hook. Nick

Something big is coming for DMS + photographers.

http://fotostheme.com

 

Nick Haskins & CO - New home for all of my PageLines Store products! 

http://nickhaskins.co

 

Better DMS - News, Tutorials, and Tips

http://betterdms.com

 

Share this post


Link to post
Share on other sites
kinek
I ended up getting this to work using a hook for 'pagelines_inside_top_primary-nav'. I couldn't find a hook that placed it in the position I wanted to like the section.nav.php file did, but I used some CSS magic to make it work. I needed to use some nagative bottom:-30px; styles to get it to work, which I really don't like doing. But in the end, it works. Thanks for the help guys.

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  

×