Conditional statements for alternate page headers if, elseif, else
-
I have a local WP install I’m working on and the header for the blog has a full width image with text overlay. This will be fine for all but 2 other pages of the site that need custom image/ text in this same position.
I have a child theme where I have customized the default header, but I want to add the code for the 2 alternate pages into the header file using if/elseif/else statements and I’m new at writing this stuff so a little help would be greatly appreciate.
Can someone please see if what I’m trying to do will work? Thanks!
Jeri<?php if (is_page ( 'upcoming-conferences' )) { MY HTML CODE HERE; } elseif ( is_page ( 'in-the-news' )) { MY HTML CODE HERE; } else { THE DEFAULT HTML CODE HERE; } ?>
I just tried it and got a blank white screen on all pages.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Conditional statements for alternate page headers if, elseif, else’ is closed to new replies.