Tagged: aweber form
-
AuthorPosts
-
June 30, 2015 at 11:42 am #466328
Good day!
I am trying to install an Aweber Pop over form on the homepage of this site http://refuze.com/. I’m supposed to paste the javascript code anywhere between the body tags of my site but I couldn’t find where it is. In the meantime I have used a plugin (HTML Javascript Adder) and added the widget in Displayed Everywhere. The pop over form did appear on other pages except the home page.
If you can let me know where to insert the code on the theme editor or if I need a specific plugin, I would greatly appreciate it.
Thanks!
July 1, 2015 at 2:22 pm #466983Hi sethriley!
Your homepage does not have a sidebar. Is that why it’s not displaying?
If you want to add it to every page of your site then add this to the bottom of your functions.php file (preferably in a child theme).
add_action( 'wp_footer', 'enfold_customization_footer_scripts' ); function enfold_customization_footer_scripts() { ?> paste your script here <?php }
Best regards,
ElliottJuly 1, 2015 at 4:06 pm #467062Hi Elliott!
Thanks for your help! I can now have the form on my homepage.
By the way, in case I don’t want it shown on specific pages or vice versa, what do I need to do? There are some pages that I don’t want the aweber form on.
Looking forward to your assistance.
Thanks in advance.
July 1, 2015 at 4:38 pm #467098Hi!
Please change your code to following one
add_action( 'wp_footer', 'enfold_customization_footer_scripts' ); function enfold_customization_footer_scripts() { if(is_page(array(2,3,4,5))){ ?> paste your script here <?php } }
2,3,4 etc. here are page ID’s. You can replace those ID’s with the pages you would like to echo the code
Regards,
Yigit- This reply was modified 9 years, 3 months ago by Yigit.
July 19, 2015 at 6:39 am #475336Hi Yigit,
I edited the code with the one you gave me and substituted the page IDs 444 and 447 as these are the only pages I want the form to show up. The final code looks like this:
add_action( ‘wp_footer’, ‘enfold_customization_footer_scripts’ );
function enfold_customization_footer_scripts() {
if(is_page(array(444,447)){
?>
<div class=”AW-Form-532465058″></div>
<script type=”text/javascript”>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = “//forms.aweber.com/form/58/532465058.js”;
fjs.parentNode.insertBefore(js, fjs);
}(document, “script”, “aweber-wjs-2e16n2lax”));
</script>
<?php
}
}However I got an error which says:
Parse error: syntax error, unexpected ‘{‘ in /home/content/61/8514261/html/wp-content/themes/enfold/functions.php on line 522
I went to the file manager and this is line 522:
if(is_page(array(444,447)){When I used the first code given to me the form shows up okay. However I only need it on these two pages:
http://refuze.com/
http://refuze.com/blog/Can you please help me out?
Thanks in advance!
July 20, 2015 at 8:01 am #475606Hey!
It looks like the if there’s a missing ) at the end, try replacing it with:
if(is_page(array(444,447))) {
Regards,
RikardJuly 21, 2015 at 7:30 am #476323Hi Rikard,
Thanks for the help. However, I no longer get the error on my website but the form is not showing anymore on the pages I want it on or any page in particular.
July 21, 2015 at 12:52 pm #476438Hi!
Yes, there was a missing ) in my code, i fixed it. Do you mind creating a temporary admin login and posting it here privately so we can look into it?
Regards,
YigitJuly 22, 2015 at 5:02 am #476845Hi Yigit,
I have provided you a temporary admin login. Details below:
July 24, 2015 at 3:13 pm #478192Hi.
Any update on my issue (#476845)? I have provided the login details already. Would appreciate your response.
Thanks.
July 24, 2015 at 11:54 pm #478438Hi!
Are you running Adblock (or similar)?
Best regards,
JosueJuly 26, 2015 at 1:31 pm #478727Hi Josue,
I don’t think so.
Also I am using a pop-over form which can be seen on all the pages if I use the first code given to me. The problem is on the second code which is supposed to have the form show up on specific pages. The code given to me on #466983 above works but it is not what I need right now because the form keeps popping up on all page and post. I only want it on specific pages and the code given to me for that doesn’t work.
I really need your help with this as I am running a campaign and it’s been a week already since I had this issue.
Thanks in advance.
July 26, 2015 at 9:31 pm #478796Hello,
I guess what you want is to show the popup in the homepage (444) and the blog (447) right? it should be like that right now, the problem was that the blog (447) is not read as a “Page” (because it was set as the WordPress “Blog”) so trying to catch it with the is_page conditional won’t work, here’s what i used:
if(is_page(array(444)) || is_home()){
Regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.