Last active
December 27, 2015 23:29
-
-
Save JulioPotier/7406741 to your computer and use it in GitHub Desktop.
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
add_action( 'wp_head', 'page_into_contact_form' ); | |
function page_into_contact_form(){ | |
if( is_main_query() && is_page( get_option( 'contact_page_id' ) ){ | |
add_filter( 'the_content', 'content_into_contact_form' ); | |
} | |
} | |
function content_into_contact_form( $content ){ | |
// $content est le contenu par défaut de l'article | |
if( $GLOBALS['post']->ID == get_option( 'contact_page_id' ) ){ | |
$content = '[contact-form-7 id="2" title="Contact form 1"]'; | |
} | |
return $content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment