-
-
Save jamiemitchell/4ab0cb16adcc263ab72744a8c1a81d26 to your computer and use it in GitHub Desktop.
This is a modified extract from Bill Erickson's Genesis 404 Page plugin (https://github.com/billerickson/Genesis-404-Page). This bit of code adds shortcode support for a search form within a Genesis page or post.
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
| <?php | |
| add_action( 'init', 'cd_register_shortcode' ); | |
| /** | |
| * Register shortcode with the theme | |
| */ | |
| function cd_register_shortcode() { | |
| add_shortcode( '404-search', 'cd_search_shortcode' ); | |
| } | |
| /** | |
| * Search Shortcode Excerpt | |
| */ | |
| function cd_search_shortcode() { | |
| return '<div class="404-search">' . get_search_form( false ) . '</div>'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment