Don't be so impatient - it can sometimes be a day before someone who knows your answer sees the thread.
You don't test for $current_page_base to be 'main_page=document_product_info', you test for 'document_product_info', similar to other page tests described.PHP Code:if ($current_page_base == 'document_product_info' and $cPath=='123' and $products_id=='229') {
Thankyou for replying. I tried what you suggested and it didn't work. The code i used was -
The first section worked. However the product_info page did not?PHP Code:<?php
/**
* prepares and displays header output
*
*/
if ($current_page_base == 'cuzhy_clothing' or 'document_product_info' and $cPath=='123' and $products_id=='229') {
require($template->get_template_dir('tpl_header2.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header2.php');
}
else
require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');?>
You didn't mention that you had multiple page base tests going on. You should use parentheses to ensure that the tests are grouped as you intend. The above won't test for $current_page_base == 'document_product_info'; to be certain, you need to state it asPHP Code:if ($current_page_base == 'cuzhy_clothing' or 'document_product_info' and $cPath=='123' and $products_id=='229') {
PHP Code:if ($current_page_base == 'cuzhy_clothing' or ($current_page_base == 'document_product_info' and $cPath=='123' and $products_id=='229')) {
I used Glen's code for my home page, and it works perfectly. But, I want to do the same for a couple of ez pages. Seems to me we should be able to insert an 'elseif' statement in there somewhere to include ezpage_id numbers. I tried the 'array' statement above, but couldn't get it to work. Any suggestions?
I think I'm looking for something like the following, but I don't know how to write it:
if ($this_is_home_page) {
require($template->get_template_dir('tpl_header_home.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header_home.php');}
elseif ($ezpage_id=="15") {
require($template->get_template_dir('tpl_header_home.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header_home.php');}
else{
require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');}
This way, my home page, as well as any number of EZ Pages could use the same header...(I think).
PHP Code:elseif ($current_page_base == 'page' and in_array($_GET['id'], explode(',', '15,27,31,8'))) {//for ez-page ids 15,27,31 or 8