- This topic has 10 replies, 2 voices, and was last updated 6 years, 1 month ago by
Leo.
-
AuthorPosts
-
October 7, 2017 at 12:48 pm #399146
Dov
Hi, I’m working with GeneratePress 1.4.3
I defined that my website first page is the one with the posts (non static).
I want to embed to this page a pop-up form, where I should embed the form code?
Thanks,
DovOctober 7, 2017 at 1:36 pm #399178Leo
StaffCustomer SupportHi there,
What is the code?
October 8, 2017 at 12:27 am #399318Dov
Hi Leo,
This is the code:
<script type=’text/javascript’ src=’//form.ravpage.co.il/03564453728986cd859418c34192a42059D7903B’ charset=’UTF-8′></script>
That I need to embed in the page where I whant the popup form to appear
Thanks,
DovOctober 8, 2017 at 8:38 am #399546Leo
StaffCustomer SupportHi there,
Try adding that in
wp_footer
hook:
https://docs.generatepress.com/article/hooks-overview/With conditional tags like this:
<?php if ( is_page( array( '1268', '6' ) ) ) : code here endif; ?>
More info here: https://codex.wordpress.org/Conditional_Tags
October 8, 2017 at 1:03 pm #399639Dov
Thanks Leo, but it doesn’t work, any clue how I can embed this code in order to get popup form?
October 8, 2017 at 2:13 pm #399669Leo
StaffCustomer SupportWhat’s the exact code you’ve tried and can you link me to the site?
Also is there instruction on how to insert the code from where you got the code from?
October 8, 2017 at 10:22 pm #399757Dov
Hi Leo,
According to the instructions I should embed the pop-up form code in the page code I want the pop-up appear.
But because I defined non static page, I don’t know where exactly to embed this code.
<script type=’text/javascript’ src=’//form.ravpage.co.il/03564453728986cd859418c34192a42059D7903B’ charset=’UTF-8′></script>
I can connect you to the site, please let me know where to send you the information in private
I really appreciate your supportOctober 9, 2017 at 2:13 am #399795Dov
As per your suggestion I tried to embed the code in this way:
wp_footer:
<?php if ( is_page( array( ‘1268’, ‘6’ ) ) ) :
<script type=’text/javascript’ src=’//form.ravpage.co.il/03564453728986cd859418c34192a42059D7903B’ charset=’UTF-8′></script>October 9, 2017 at 8:21 am #400016Leo
StaffCustomer SupportThe numbers 1268 and 6 are just for example. You will need to change that.
Or use the page plug method. See info here: https://codex.wordpress.org/Conditional_Tags#A_PAGE_Page
For blog page: https://codex.wordpress.org/Conditional_Tags#The_Blog_Page
October 12, 2017 at 9:39 pm #402348Dov
Hi Leo,
I embed the code in 2 ways but I didn’t get the popo-up only in the blog first page.
The 2 ways:
1. The way suggested in WordPress CODEX:
?php if ( is_front_page() && is_home() ) {
// Default homepage
} elseif ( is_front_page() ) {
// static homepage
} elseif ( is_home() ) {
// blog page
} else {
//everything else
}:
The result is the pop-up form appear in every single page and post2. The way you suggested:
<?php if ( is_front_page() && is_home() ) {
// Default homepage
} elseif ( is_front_page() ) {
// static homepage
} elseif ( is_home() ) {
// blog page
} else {
//everything else
}: >
The result is that the pop-up form is not showed in any page or post in the blog
What I’m doing wrong?October 13, 2017 at 9:05 am #402663Leo
StaffCustomer SupportIf you are using blog page as the front page and only want it to show on that page then try this:
<?php if ( is_front_page() && is_home() ) : ?> code here <?php endif; ?>
-
AuthorPosts
- You must be logged in to reply to this topic.