Forked from cobaltapps/my-function-that-does-stuff-conditionally.php
Created
March 7, 2019 02:18
-
-
Save DalavanCloud/91e056f73f41876096c2961b00e1a845 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