I am new in php. I want to make a condition for showing page id and set my image name is pageId and show this background image in my header banner. How to fetch page id use it fetching image for my banner background img.
Here is my code:
<div class="splash"> <img src="<?php echo get_template_directory_uri(); ?>/images/<?php echo $page;?>.jpg" /> </div>
and it is also working in loop in different page change header banner image if change page.
I have a problem in this code. It is working fine for pages but if i go inner pages or post of a page it shows banner i want to hide that. how can i do it