Jump to content
Sign in to follow this  
jamesldesign

Adding a new menu on a custom page template

Recommended Posts

jamesldesign

Im trying to add a new menu location on a custom page template, and nothing is showing up. (Thought I posted this earlier but I dont see it under my activity, so I must not have). On my functions.php file I have this:

function register_my_menus() {
	  register_nav_menus(
	    array('priorities_menu' => __( 'Priorities Menu' ) )
	  );
	}
	add_action( 'init', 'register_my_menus' );
On my custom page template, page.priorities.php, I have:
add_action('pagelines_loop_before_post_content','priorities_custom_menu');
	
	function priorities_custom_menu() {
	
	wp_nav_menu( array( 'theme_location' => 'priorities_menu' ) );
	}

Nothing is showing up. Any recommendations? Thanks

Share this post


Link to post
Share on other sites
catrina
Is page.priorities.php in the right folder (the Pagelines Customize folder)? Also, are you checking Appearance > Menus do you see the options for adding your new menu?

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
jamesldesign
Yes, page.priorities.php is in the child theme and appearance > menus has been correctly set thanks

Share this post


Link to post
Share on other sites
catrina
Where in functions.php are you adding the function code? Is there no live link available for you to post? It would make it easier for moderators to check your site to see what could be wrong.

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
jamesldesign
I am developing on MAMP right now. If you can answer my question without me having to put a test version online that would make things a lot easier for me. Below is my entire functions.php located in the child theme folder [code] require_once(STYLESHEETPATH . "/advanced.php"); // ==================================================== // = YOUR FUNCTIONS - Where you should add your code = // ==================================================== // ABOUT HOOKS --------// // Hooks are a way to easily add custom functions and content to PageLines. There are hooks placed strategically throughout the theme // so that you insert code and content with ease. // ABOUT FILTERS ----------// // Filters allow data modification on-the-fly. Which means you can change something after it was read and compiled from the database, // but before it is shown to your visitor. Or, you can modify something a visitor sent to your database, before it is actually written there. // FILTERS EXAMPLE ---------// // The following filter will add the font Ubuntu into the font array $thefoundry. // This makes the font available to the framework and the user via the admin panel. function register_my_menus() { register_nav_menus( array('priorities_menu' => __( 'Priorities Menu' ) ) ); } add_action( 'init', 'register_my_menus' );[/code]

Share this post


Link to post
Share on other sites
Rob
This topic really needs the attention of one of our developers. Unfortunately, I'm unfamiliar with the hook you're using. As I understand it, you simply wish to add a new menu section to your site. Where do you wish to place it on the page? There may be different ways of handling this that don't require a hook. If you let me know where you wish to place it, I may be able to give you some options. Can you take a screenshot and link it here, showing what and where you wish to place this menu? That would help quite a bit. Thanks.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
jamesldesign
Thanks for the help, I'm happy to pay a pro for it - I tried to hire someone but he didnt respond and then said he was too busy. Any other recommendations for programmers, not just designers like myself, would be much appreciated. at this point Im going to have to cut my losses and re-design

Share this post


Link to post
Share on other sites
Rob
I've escalated this and someone should be reaching out to you shortly. I'm in NYC for the day Monday. Again, if I knew where you wanted to place the menu I might have some easy solutions.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
meilena
I'm going to alert one of our developers to see if they can direct you on this process. In the meantime if you can provide some more details on where you are wanting to place the menu, even a screenshot with an arrow to the location would be great. Try using Jing to help with displaying this to us: http://www.techsmith.com/download/jing/default.asp

Meilena Hauslendale

PageLines.com

"A Better Way to Build Websites"

Share this post


Link to post
Share on other sites
Simon
You cannot add menus to page templates. You need to use a child theme, install the base child theme then add this to the functions.php in that theme folder: http://paste.pagelines.com/1u

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  

×