Archived

This topic is now archived and is closed to further replies.

  • 0

Resolved Display menu conditionally based on template


Question

Posted · Report post

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

5 answers to this question

Posted · Report post

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

Posted · Report post

The topic was marked as resolved.

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

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.

Share this post


Link to post
Share on other sites

Posted · Report post

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