haha, fair enough, i read it through and thought it made sense but then it would to me wouldn’t it. and anyway, the bump got your attention ??
so i have a new sidebar, that is called when on any page that is in my new Shop template. The shop template is applied to 4 separate Pages, and therefore on each of those Pages the new sidebar is called.
In that sidebar i want to show an unordered list of four items that i write in myself. Each list item will have a class of, for example, ‘yes’ or ‘no’. In my css all of the times where a yes class is shown a tick will be output next to the list item. if it is no then the tick will not be there.
so the list will need to be different depending on what p
Page you are on, as it is showing how far through the order process you are.
for the first page, where none of the list items will have the class yes, as nothing has been done, it will look like this.
<ul>
<li class="no">First Item</li>
<li class="no">Second Item</li>
<li class="no">Third Item</li>
<li class="no">Fourth Item</li>
</ul>
As you progress though the shop, to the checkout and transaction results page etc, the list needs to be different. like so for example:
<ul>
<li class="yes">First Item</li>
<li class="yes">Second Item</li>
<li class="no">Third Item</li>
<li class="no">Fourth Item</li>
</ul>
you get the picture.
So to decide which list to display, and instead of having a different sidebar for each Page of the Shop template, i wanted to create a series of if statements.
The only problem is that i get a parse error saying unexpected <
etc when i put the list i created in the if statement straight up. So i would like to know how to display the contents of the if statement, rather than just using it to perform a function.
I know that the if statement is correct, cause as i said i can get functions to be performed such as wp_list_pages. But as there is no function for what i want, this working is no use to me.
I hope ive explained what i want better now?
I know that there is another solution to this, and that is to create different sidebars, and include an if statement in the Shop template to decide which one to display, but i dont want to have to create all the extra files if i can avoid it.
thanks otto, hope you can help