Skip to content

Instantly share code, notes, and snippets.

@jbutko
Created September 24, 2013 16:30
Show Gist options
  • Save jbutko/6687391 to your computer and use it in GitHub Desktop.
Save jbutko/6687391 to your computer and use it in GitHub Desktop.
PHP, WP, Contact Form 7: Echo Contact Form 7 form if it is installed (if function_exists)
<?php
if (function_exists('wpcf7')) {
echo do_shortcode( '[contact-form-7 id="413" title="Contact form 1"]' );
} else {
echo "<p class='title'>Please install <a href='http://wordpress.org/plugins/contact-form-7/' rel='nofollow'>Contact Form 7</a> plugin and build some contact form. Then use your shortcode on the contact page.</p>";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment