Wordpress Custom Page Template...

Andrewkar

...
BuSo Pro
Joined
Nov 6, 2014
Messages
402
Likes
217
Degree
1
Guys,
I have problem with adding custom page template to WP theme (this one http://themeforest.net/item/apply-app-agency-wordpress-theme/11639239 )

I can see that template in Page Attributes -> Template , it's there. I can select it as well. Template is called template-nav.php

This is what I see when looking at source code:

Code:
<body class="page page-id-2167 page-template page-template-template page-template-template-nav page-template-templatetemplate-nav-php full-width element-round page-load-on wpb-js-composer js-comp-ver-4.5.3 vc_responsive" id="body">
Does it look normal?

And here is the code when default template is selected
Code:
<body class="page page-id-2165 page-template-default full-width element-round page-load-on wpb-js-composer js-comp-ver-4.5.3 vc_responsive" id="body">

My goal is to create template with hard coded menu for pages like contact, about etc. In general it's one page theme. Homepage have menu just with anchors to specific content below the menu. So if I click on a separate page like contact for example, menu on that page doesn't fully work.

Normally I could create new template and all was good. This time not really. Or maybe you know some other way to get that menu working right?
 
Yea that looks normal. I think page templates are supposed to begin with page- for the filename though, so it would be page-template-nav.php.

It would be easier to ask the theme creator what hooks he added so you can add that nav without a page template. You should just be able to edit your functions.php and hook your secondary nav on those pages.

It's possible to just hook above/below the WP head and body too (Google search should bring that up for you). That might not work well with this theme depending on how it's coded (like it may not be the area you want).
 
@juliantrueflynn thanks for ropes

I've tried that option with a prefix page, and it doesn't work. The funny thing is that body class shows that new template is (or should be) loaded, but there is still wrong menu...

I have contacted support already, hope they will get back to me before Xmas :D
 
If you post the PHP of one of the regular pages on any code-sharing site I can probably give you the functions.php needed to edit it. That way I can see all the actions/hooks that the developer put.
 
Back