Community Forums › Forums › Archived Forums › Design Tips and Tricks › embedding a signup form at the bottom of each post
- This topic has 4 replies, 2 voices, and was last updated 11 years ago by Nick Ellison.
-
AuthorPosts
-
March 25, 2013 at 7:59 am #31101Nick EllisonMember
Hi. I'm trying to embed a Aweber signup form at the bottom of every blog post automatically. I'm using Genesis simple hooks to do it.
The problem I'm having is that the form is also showing up on the homepage under each excerpt. Could someone help me stop this part from happening please? I'm told I can combine my code with a wordpress conditional like is_single() but quite honestly I have no idea what that means as I can't code.
Here is my form: <script type="text/javascript" src="http://forms.aweber.com/form/51/1674181151.js"></script>
Would anybody be able to show me where the code goes please? Or if there is another way to achieve this.
Thanks
Nick
March 25, 2013 at 8:07 am #31102Brad DaltonParticipantCan you link to your site please.
Adding the conditional tag, is_single() will restrict the output to single posts only.
Rather than use Simple hooks, you could add a widget area after all single posts and drag in the Genesis eNews extended widget or Aweber form plugin/code.
Here's the PHP code you can add to the end of your child theme's functions.php file.
You can easily change the location where the widget content displays by changing the genesis hook.
April 3, 2013 at 3:43 am #32791Nick EllisonMemberHi Brad. So sorry I never realised you had replied. Thank you so much for helping out.
My site is http://www.nickellison.net
I took your advice and code and added it the function.php file. It's 99% working! I just have an alignment issue. Instead of the sign up form sitting directly under the post it sits right in the middle of the site, crossing half of the post and half of the sidebar. Is there an easy fix for that? (I've taken it down so you won't be able to see it but here's a screenshot http://nickellison.net/wp-content/uploads/2013/04/Screen-shot-2013-04-03-at-10.33.58.png
One other issue is that I'm inserting the aweber code straight into the text widget, so it's not mobile responsive as per the theme. Do you know of a way I can either make it respond or replace it for a different form when opened on mobile?
Thanks for your help
Nick
April 3, 2013 at 6:47 am #32802Brad DaltonParticipantThat has to do with the aligment of your form.
You can fix this many ways but try pasting the code for the form into your WordPress text editor and aligning it left or align none.
Why not use the Aweber plugin and drag the widget into your new area.
Is the Aweber plugin responsive?
April 3, 2013 at 2:57 pm #32916Nick EllisonMemberHi Brad
I just tried doing it that way. Got the aweber plugin and got it all connected up ok but had the same problem, the form was centered in the middle of the site for some reason. Anyway I went back to the other way of using the after_content_hook but this time I used the full html instead of the javascript snippet and it seems to be working just fine.
Still not mobile responsive, but neither was the aweber plugin. Not sure what to do about that bit...
If you have any ideas I'd appreciate the help, but not to worry if not, at least it works on desktop so far!
Thanks again
Nick
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.