Good Morning All, I am in need of some help in doing the following code within wordpress. I am currently using the following setup but I know it can be done better. This is what is needed. 1ad for the home page only - 1 ad for the rest of the site SO I did the following In my header I am calling <?php include (TEMPLATEPATH . '/headbanner.php'); ?> Code (markup): headbanner.php has the following code in it. <div class="headbanner"> <?php if (is_home()) { include('homead.php'); } ?> <?php if (!is_home()) { include('nonhomead.php'); } ?> </div> Code (markup): With that said the homead.php and nonhomead.php files have my scripts for my ads in them. Is there a cleaner way to put all of this in one call in the header or is this the best way to do it?? Any help would be appreciated and FAST!!
You can use an if else statement instead of 2 if statments I suppose as your last one is rather redudant so: <?php if (is_home()) { include('homead.php'); } else{ include('nonhomead.php'); } ?> and seeing as it's only a few lines of code why include it in a seperate file your better just shoving it in the header rather than having the include. You could take this even further and get rid of the 2 includes in your if statement and put the actual code inside the statement instead.