Last active
October 8, 2022 12:03
-
-
Save TANVIRFAZLEY/a5abf94c148c8f3682e71b604ffd2817 to your computer and use it in GitHub Desktop.
Using Conditional Tags in Page Templates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( is_front_page() ) : | |
get_header( 'home' ); | |
elseif ( is_page( 'About' ) ) : | |
get_header( 'about' ); | |
else: | |
get_header(); | |
endif; | |
//another Exam | |
<?php if( is_home() || is_front_page() ) : ?> | |
<!-- Homepage Only Code --> | |
<?php else : ?> | |
<!-- Other Page Code --> | |
<?php endif; ?> | |
https://developer.wordpress.org/themes/basics/conditional-tags/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment