Hey, I would like someone with php knowledge to help me create a custom sidebar per page.
I have an idea…
In my main template (I use a single template for everything) I want to include a page which I will style with CSS as a sidebar. I want the include php command to search for a page named after the current page + sidebar at the end. For example if you are viewing the “about” page, then a file called “aboutsidebar” (or something) is included.
I hope I’m clear. It sounds easy but I don’t know php.
My question is – how do you get the name of the current page? So basically what is the php code for including a file with a name taken from the current page + sidebar at the end?
And in case the file to be included doesn’t exist, does php create a problem?
Sory, I’m a beginner…
- The topic ‘Custom Sitebar per Page – solution?’ is closed to new replies.