Support » Plugin: MC4WP: Mailchimp for WordPress » How to insert the MailChimp form after Post?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Danny van Kooten

    (@dvankooten)

    Hi Vishesh,

    I wrote a post about that on my blog: Add MailChimp sign-up form to end of all posts.

    Basically, it comes down to adding the following lines of code to your theme its functions.php file.

    function mytheme_add_signup_form_to_posts( $content ) {
        if ( is_single() && get_post_type() == 'post' ) {
            $content .= mc4wp_get_form();
        }
        return $content;
    }
    
    add_filter( 'the_content', 'mytheme_add_signup_form_to_posts' );

    Hope that helps!

    Thread Starter vishesh.kachheda

    (@visheshkachheda)

    It worked bro!
    Thanks a lot.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to insert the MailChimp form after Post?’ is closed to new replies.