Conditional sidebar sections
Sorry about the length on this one.
I’m using a modified version of Blix. The only parts that are really modified are the stylesheet (and not structurally) and the sidebar. Blix uses conditional statements to add different sections do different pages of the site. For example, single pages have a calendar on the side, while the main page does not.
Here’s the rub.
I’ve got a writing section where I’m going to post two or three of the longer works of fiction I’ve written. In the main menu, you’ll go to WRITING. On the writing page, there’s a conditional statement in the sidebar that will create a menu of the different stories.
Each link will go to a story page, and the sidebar will contain a table of contents (chapter one, chapter two, etc). Each story page is a child of the writing page.
Each chapter will have its own page as well, which will be children of each story page. The permalink structure will come out like:
Conditional statements for is_page(“writing”) and is_page(“seasons”) are easy enough. Is there a feasible way to add a conditional statement for each chapter page without having to go through is_page(“chapter-one”) || is_page(“chapter-two”)… so on and so forth?
Is there some way to say “if this page is a child of ‘seasons,’ give it this section?
- The topic ‘Conditional sidebar sections’ is closed to new replies.