You already know the 3 reasons why I love Genesis. What I didn’t know is some of you like my opt-in form after my posts but don’t know how to do it.
Although I was reffering my readers to Brian’s tutorial (see here), I’ve decided to explain how I did it, so that you can benefit as well.
In order to follow this tutorial, you must have the Genesis Framework for WordPress, otherwise it won’t work.
Ok, lets get started.
1. Create a new Newsletter.php script
Copy the code below into notepad, replace the text the way you want it appear in your opt-in form.
Under the line 10 goes your Twitter “Follow” button. Obviously you’ll want to replace the DomainsFlow mentions with your own Twitter username.
Between the 12-18 line I placed my Feedburner code (ok I know I should change my email provider but that’s another story). Again, here you replace with the code of your email service.
Save the text file as newsletter.php, and then upload it into your child theme’s folder. Example location: domainsflow/wp-content/themes/eleven40.
2. Hook an opt-in form after each post
Hook it with the code below so that an opt-in form will appear after all your posts. Just copy the code below into your functions.php script (Appearance > Editor > functions.php).
3. Opt-in form style
Obviously we need to put a little style on this opt-in form. Download the “Sign Up” ribbon that shows at the top left corner. Save the image to your desktop and upload it to the image directory on your hosting.
Now, copy the code below into your style.css sheet (Appearance > Editor > Stylesheet).
I know that everyone’s style is different, so change the Genesis opt-in form how you like. That’s it!
Building your email list
Did you notice that we didn’t mention any plugin? That’s right, it’s not necessary.
Although you can use the Genesis eNews Extended plugin and place it after the post section (I use it in the footer), somehow I preffer without the plugin.
Now that you’ve successfully added your opt-form after your blog posts, it’s time to boost your email list.
If you have some difficulties in use of this tutorial, or would like another one, put it in the comments below.
Hi,
I follows all the steps mentioned above, but I am not seeing the sign up newsletter section on my website.Could you please help me to know where I am going wrong?
My website is http://www.technospace.co.in
Hi Pradeep,
Since nothing is appearing after your post I assume you did something wrong in step #1 or #2. If you’ve done these correct something should appear.
So once again:
1. create a newsletter.php script
2. paste the hook code in your functions.php script
I tried the steps. Could you please confirm once again where to place the newsletter.php file. Which location I need to place the file?
It’s the same location where is your functions.php and style.css files. So in your case it should be public_html/wp-content/themes/eleven40.
where have you defined the variable CHILD_DIR ?
Thanks. You’re missing a download link for enews-subbox.png, but I was able to get it by dissecting your css.
In case people are looking for it. Here’s the URL for the image. https://www.domainsflow.com/wp-content/themes/eleven40/images/enews-subbox.png
Now it works fine =)
Thanks for bringing that to our notice. I appreciate it.
Hi,
How to create feedburner url? I guess google does not support it. Can you add a post on how to get a feedburner to the blog?
Hi Pradeep,
There are plenty tutorials about creating feedburner account (URL). You can check one here.
Hi,
thanks for this . I haven’t seen many bloggers use this technique of adding signup form after post. also would to know how you display code with numbers . is there any plugin for this .
regards
vinodh
Hi Vinodh,
Under each code you’ll notice a link says GitHub. It’s not a plugin but code sharing and publishing service. I find it very practical because for all code modifications you don’t have to edit the post. It’s all done on GitHub.
Give it a try and the best thing it’s free.
the ribbon nicely reminds the user to signup. where as the one in footer is plain simple.
regards
vinodh
I’m glad you like my opt-ins, and I hope you already signed up. 😉
Thanks Vinodh for stopping by.
Hi Dragan,
After doing step two i got this error……please help.
“Parse error: syntax error, unexpected ‘<' in /home/a7888901/public_html/wp-content/themes/eleven40/functions.php on line 67"
Hi Hardik,
You obviously did something wrong in functions.php because everything is working fine with my site.
I suggest you check again this 67 line and make sure it’s exactly like in tutorial. See again if you’re maybe left some opened brackets etc.
If you still remain with the error contact me and I’ll check your php script.
Hi Dragan,
Thanks in advance for your rapid replay.
As you suggest to look on line 67, I found there something and edited but Dragan after that it replay me a another error message,this time on line 1, I fed up with it. So please do something for me. “Parse error: syntax error, unexpected T_REQUIRE_ONCE in /home/a7888901/public_html/wp-content/themes/eleven40/functions.php on line 1”
Where I do have to send you my functions.php?
Acutally I love your humbleness of response attitude.
Thank you.
Hardik, I sent you an email so make sure to attach your functions.php file.
You’re welcome and I’ll be glad to help.
Hi Dragan,
At first thanks for solving my function.php line 1 error now i got my site.
But still i’m not getting my Newsletter after my post,rather its giving me another error on my newsletter.php but I have properly pasted the code from here.
Error-“Parse error: syntax error, unexpected ‘<' in /home/a7888901/public_html/wp-content/themes/eleven40/newsletter.php on line 3"
Now again I need your fever.
Thank you.
Hi Hardik,
In your newsletter.php script remove that from line 1. It should now appear your opt-in after the post.
Tell me how it went, and I’ll make that correction in the tutorial.
Yes……..now its work.
A very huge thanks to you Dragan, I’m glad to being a fan of Domains Flow.
Please keep it up.
Thanks a lot.
Hardik
Do you mind if i ask you to share the texture you use in this page.
https://www.domainsflow.com/responsive-wordpress-themes
I need this background texture which you have used on your above page.
Hardik, I use this texture as my background. This page is called Subtle Patterns and you have a plenty of textures for free, great resource.
Hello Dragan,
This is indeed an awesome tutorial. I followed the steps as they are and finally got the Newsletter Sign Up Box to work on my blog. Is really awesome as it matches the Genesis eleven40 pro theme .
Thanks to Brian Gardner and you for a job well done. Awesome!
How can I hook this in after the ‘after entry widget’?
Hi Dragan, I did everything exactly and there are no errors. Wondering why the opt-in form isn’t showing up. Nothing. Can you help?
I figured it out. It had something to do with the hook reference ‘genesis_after_post_content’. According to the studiopress’s hook reference guide that is xhtml and for some reason didn’t work. When I changed the hook to ‘genesis_after_entry_content’, which is html5, the newsletter worked perfectly.
Hi Nick,
By the time I wrote this tutorial Genesis was running on XHTML and now the hook reference won’t work on HTML5. Instead of ‘genesis_after_post_content’ you can also put ‘genesis_entry_footer’.
I’m glad you figured it out.
Have a nice day,
Dragan
Thanks for this Dragan – been looking for something as simple as this for a while!
Oh, thank you for this post with useful tutorial. I just need it to one of my blog that use Genesis framework and Epik template. It helps me easy to setup opt-in form.
Hi Annette,
I’m glad you find this tutorial useful. Yes opt-in is very important part of any blog.
hello Dragan Palla,
I like this signup form and specially the ribbon.
Hi,
I just followed all the above-mentioned steps but unfortunately, I didn’t get any output. This is my site http://thegeektricks.com You’d please help me out to.
Thanks
Hi Nikhil,
You obviously missing some step. I used this tutorial here on DF and as you can see it’s working fine. Read this tutorial carefully again and it should work.
Nice tutorial, i really appreciate your writing and tricks.
Thanks!
Thanks Ataul,
I’m glad you find my writing helpful.
~Dragan