How to add email subscription box to default post and page template? (10 posts)

  1. Mark Collier
    Posted 5 years ago #

    I would like to add a horizontal email subscription box to the post and page templates so that I don't have to add it manually in the HTML each time I create a post.

    The code is:

    <iframe src="http://www.theopenalgorithm.com/forms/horizontalform.html" frameborder="0" scrolling="no" height="" width="500">

    How can I add this to the code so that it shows up below my posts and pages?

    Thanks for your help in advance.

  2. Put it in your theme template. It should be single.php, depending on your theme.

  3. Mark Collier
    Posted 5 years ago #

    Hi Ipstenu

    Thanks, I tried that and I got a fatal error, when I removed the code and updated the file again it was back to normal.

  4. What theme are you using?

    If it's causing a fatal error, then either you put it in a bad place or the content of the frame is evil.

  5. Mark Collier
    Posted 5 years ago #

  6. Something like this should work: http://pastebin.com/c5tehCtU

    Depends on where in the post you want it, though.

  7. Mark Collier
    Posted 5 years ago #

    Thanks very much I really appreciate the help, I have updated the file.

    Is there any way to move the iframe/subscription box to just below the content?

  8. Sure :) Move it from line 25 to line 19

    Like this: http://pastebin.com/s1L4wL4R

    I suspect you were putting it inside the PHP tags, which would have weird effects ;)

  9. Mark Collier
    Posted 5 years ago #

    Didn't quite work see: http://www.theopenalgorithm.com/other/why-you-shouldnt-monetize-your-new-blog/

    I have a feeling that: <?php
    essentially mean the body and the plugins below the post.

    Is that correct?

    If so do I need to edit another file with those plugins to have the email subscription box show up above the related posts and just below the content?



  10. the_content() is the call to ... your content :) That's what WP uses to echo your post.

    It is showing below your content, but you have other plugins and theme settings that are causing it to be bumped down.

Topic Closed

This topic has been closed to new replies.

About this Topic