Can I use the pageID as an argument in an IF?
-
Hi,
THE PROBLEM
I have a collection of 9 page templates, the ONLY difference on each page template is in the line below:
<?php wp_list_pages(‘title_li=&&child_of=18&depth=3’); ?>
My page templates basically produce a different ‘site map style’ list of different levels of sites page structure. Therefore the only thing that changes in the above PHP is ‘child_of=18’. Where the child-of number indicates the parent page to build the list from. Examples of what I mean are as follows:
https://jav.towerscape.co.uk/cameras/eastern/
https://jav.towerscape.co.uk/cameras/north-east/
https://jav.towerscape.co.uk/cameras/north-west/
etcTHE QUESTION
My question is, is can I somehow capture the pageID of the current page into a variable, use that variable as an arugment in a series of IF statements in a single template, as opposed to having 9 individual templates. Obviouslly having a lot of different page templates is a problem as I have to make changes throughout every page when I make a change to the master template.
- The topic ‘Can I use the pageID as an argument in an IF?’ is closed to new replies.