Jump to content
Sign in to follow this  
caleb

Display menu conditionally based on template

Recommended Posts

caleb    0
caleb

Hi,

I want to display a menu on all pages except those based on a certain template. Here's what I'm trying, but it's still showing the menu.

if ( is_page_template('pagelines/page.epsilon.php') ) {


} else {

add_action('pagelines_before_branding_icons', 'brand_menu');



}


function brand_menu(){


wp_nav_menu( array('menu' => 'Main Menu' , menu_class => 'sf-menu'));


}

Thanks for helping out,

Caleb

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

Hi,

I think the best course of action would be to ask this question on the Wordpress support forums. This is more of a Wordpress related issue than a PageLines one.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
caleb    0
caleb

I'll try there as well. I guess the question related to pagelines would be what template file, including path, is a page created with template 5 for example, based on such that this statement would return true

if ( is_page_template('pagelines/page.epsilon.php')

Share this post


Link to post
Share on other sites
Rob    547
Rob

Caleb,

As you know, we've provided quite a bit of support on this via LIVE, however, it is essentially a customization issue and I'm going to refer you to our Pros section. One of them might be able to help you with this, but it's so complex that neither the forum or LIVE are the proper places to get the right answers.

http://www.pagelines.com/pros


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
caleb    0
caleb

ok, thanks for trying. just to close this out, i couldn't figure out how to get it be conditional on a pagelines template, but i did get it to work based on page id with the following:

add_action('pagelines_before_branding_icons', 'brand_menu');

function brand_menu(){

if ( ! is_page(array(356,681,58,533)) )

wp_nav_menu( array('menu' => 'Main Menu' , menu_class => 'sf-menu'));

}

Someone else may find this useful more generically with the hooks to apply add actions to only certain pages.

Share this post


Link to post
Share on other sites
mackenzie    12
mackenzie

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

Sign in to follow this  

  • Similar Content

    • 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?

    • khat
      By khat+
      I think I may have installed pagelines pro incorrectly, and then used features incorrectly. I installed first platforms framework theme and then the child, thinking I could do setup for child later. I tried to set up a background image, and tried custom css feature in pagelines dashboard. I had mistakes in my css, and just thought that if I deleted the info in the css custom feature in pagelines dashboard that the new information would overwrite the old info. The background image didn't respond at all, probably because I didn't have the child directory renamed. I then tried to use the LSS plugin to create css and added more css, possibly, somewhere -sigh-. I never did change the background image and get it placed properly. I used a workaround and in nested containers I placed a background image which worked well enough, so I moved on to try to create my nav bar/ menu bar. When I go to the Menus panel, there is NO area where I can place a menu on a page. I have read and reread and re- re- reread the instructions for placing a menu. I've used the pagelines editor to place a menu, however only HOME shows up. I've been at this for many hours. I've since uninstalled all of my pagelines items and reinstalled, thinking that it would restore all my changes to default, but no, it is still all there, with all my unresolved issues. I am completely at a loss as to what to do next.
    • Jarek
      By Jarek+
      How to make the Impulse menu sticky?
      Here is a site that seems like it is doing just that: http://www.manhattanperiodontist.com/
      Here is the site I am working on: http://boeriu.digitalvector.com/ 
      I have no problem showing the menu at the bottom, but when scrolling up it does not stick.  I tried to add Nav Pro menu but when I do that, it just shows on top and no matter what I try is not working as I want it to.
      Any suggestions?
    • Dave
      By Dave+
      1) Toggle menu on mobile devices does not work properly, combination Chrome 56.0.2924.87 with Android 6.0.1

      2) Mobile / Default Menu > Set the primary/default navigation for your site. This will be used in the pop out mobile menu and as the default in navigation sections. Does not work.
    • David
      By David+
      We are building a long-page scrolling site with Pagelines 5. Our menu is made with # links that go to a container's unique ID, e.g. container_ux7al6g
      This works, but it doesn't look great in the menu. Is it possible to assign a 'nice' # link, e.g. /#solutions ? 
      We used to do this in the DMS2 platform through a workaround, but that doesn't seem to be possible now. 
      Any suggestions? 
×