Last active
March 7, 2019 02:19
-
-
Save cobaltapps/c381ac70d8971aebbcb40fd7e5196fbf to your computer and use it in GitHub Desktop.
Learning To Code In PHP: The adding conditional code.
This file contains hidden or 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
// Use this if working with Genesis | |
//add_action( 'genesis_before', 'my_function_that_does_stuff' ); | |
// Use this if working with BB Theme | |
//add_action( 'fl_body_open', 'my_function_that_does_stuff' ); | |
function my_function_that_does_stuff() { | |
if( is_page() ) { | |
echo 'Hello Page!'; | |
} elseif( is_single() ) { | |
echo 'Hello Post!'; | |
} else { | |
echo 'Hello World!'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment