Possible to insert embed code in all past and future posts?

Hello,

Is it possible to use the Edit CSS plugin to add a bit of embed code to all past and future posts so I don’t have to manually insert it every time I post? If so, can you advise what code should be added?

Hello there,

What is the objective of doing so? Could you please be more details, so I can be more exact?

Regards,
Kharis

Hello, Kharis, thanks for responding.

I’d like to set it up so the embed form to sign up for my email newsletter appears at the end of each post on my site.

What plugin are you using for that newsletter signup form?

Regards,
Kharis

I use Mailchimp and simply embed the form on the site.

Hello there,

Could you please share the embed code you would like to use? Knowing it would help me to decide what route we can use.

Regards,
Kharis

Here it is:

<!-- Begin MailChimp Signup Form --> <link href="//cdn-images.mailchimp.com/embedcode/classic-10_7.css" rel="stylesheet" type="text/css"> <style type="text/css"> #mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; } /* Add your own MailChimp form style overrides in your site stylesheet or in this style block. We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */ </style> <div id="mc_embed_signup"> <form action="//CentersMorningRead.us14.list-manage.com/subscribe/post?u=a5fb7aa695abd200b404d1ed0&id=07252b7ee0" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate> <div id="mc_embed_signup_scroll"> <h2>Subscribe to our mailing list</h2> <div class="indicates-required"><span class="asterisk">*</span> indicates required</div> <div class="mc-field-group"> <label for="mce-EMAIL">Email Address <span class="asterisk">*</span> </label> <input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL"> </div> <div class="mc-field-group"> <label for="mce-FNAME">First Name </label> <input type="text" value="" name="FNAME" class="" id="mce-FNAME"> </div> <div class="mc-field-group"> <label for="mce-LNAME">Last Name </label> <input type="text" value="" name="LNAME" class="" id="mce-LNAME"> </div> <div class="mc-field-group"> <label for="mce-MMERGE3">Zip Code <span class="asterisk">*</span> </label> <input type="text" value="" name="MMERGE3" class="required" id="mce-MMERGE3"> </div> <div id="mce-responses" class="clear"> <div class="response" id="mce-error-response" style="display:none"></div> <div class="response" id="mce-success-response" style="display:none"></div> </div> <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups--> <div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_a5fb7aa695abd200b404d1ed0_07252b7ee0" tabindex="-1" value=""></div> <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div> </div> </form> </div> <script type='text/javascript' src='//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'></script><script type='text/javascript'>(function($) {window.fnames = new Array(); window.ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]='LNAME';ftypes[2]='text';fnames[3]='MMERGE3';ftypes[3]='zip';}(jQuery));var $mcj = jQuery.noConflict(true);</script> <!--End mc_embed_signup-->

Hello there,

Try adding this function into your child theme’s functions.php or you can use the functionality plugin like Code Snippets.


function sydney_child_add_bottom_content($content){

  $html = '';

  if(is_page() || is_singular('post') ):
  ob_start();

  ?>

  <!-- Replace this line with your signup form. -->

  <?php
  $html = ob_get_clean();
  endif;

  return $content . $html;

}
add_filter('the_content', 'sydney_child_add_bottom_content');

Regards,
Kharis