jezThomp
Member
Posted 1 year ago #
You can have if home page show so something....
Is it possible to have if post id or page id, show the following....?
So on page a you have banner a, on all other pages you have banner b.
Is this possible, rather than having different includes for different pages?
Many thanks :)
jezThomp
Member
Posted 1 year ago #
Oh brilliant thanks..:)
How would i go about adding some together?
<?php
is_page(42);
show......
is_post(10);
show....
everything else show....
?>
That possible?
:)
Depends on where the banner is placed ;-)
jezThomp
Member
Posted 1 year ago #
Well i was thinking whenever really....
Or can it only be placed inside or maybe outside the loop?
jezThomp
Member
Posted 1 year ago #
<?php
if(is_page(42)){
Show something only for page 42
} else {
Show something for all other pages
}
?>
You can use is_page() anywhere. It doesn't have to be in the loop.
jezThomp
Member
Posted 1 year ago #
Thank you but that doesn't work :(
Get a syntax error.
Post the code you used...
jezThomp
Member
Posted 1 year ago #
<?php
if(is_page(15)){
contact page
} else {
rest of pages
}
?>
Also trying to do multiple ones but had no look either... :(
<?php
if(is_page(15)){
contact page
elseif(is_page(30)){
book page
} else {
rest of pages
}
?>
jezThomp
Member
Posted 1 year ago #
That wrong, or am i just missing something....?
ryan4021
Member
Posted 8 months ago #
try adding an } before elseif(is_page()){