Jump to content

Check for template name...


spoetnik
 Share

Recommended Posts

I give up. I can't find out why this isn't working:

// display sidebar navigation, except on homepage, projects, posts, and partners pages
if($page->template->name === 'home'|'project'|'projects'|'posts'|'partners'){
	echo "no sidebar";
}else{
	echo "sidebar";
}

Can someone help?

Link to comment
Share on other sites

You are not using a PW selector. This needs to be in PHP syntax:

if($page->template->name == 'home'|| $page->template->name == 'project' || $page->template->name == 'projects' || $page->template->name == 'posts' || $page->template->name == 'partners'){

But maybe instead you could see if the $page->sidebar actually exists. Maybe that won't work in your scenario, but thought I should mention it just in case.

  • Like 1
  • Thanks 2
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...