Black Friday Sale! Get up to $40 off GP Premium!Learn more

[Support request] Pop up form in non static first page

Home Forums Support Pop up form in non static first page

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #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,
    Dov

    GP Premium 1.4.3
    #399178
    Leo
    Staff
    Customer Support

    Hi there,

    What is the code?

    #399318
    Dov

    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,
    Dov

    #399546
    Leo
    Staff
    Customer Support

    Hi 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

    #399639
    Dov

    Thanks Leo, but it doesn’t work, any clue how I can embed this code in order to get popup form?

    #399669
    Leo
    Staff
    Customer Support

    What’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?

    #399757
    Dov

    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 support

    #399795
    Dov

    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>

    #400016
    Leo
    Staff
    Customer Support

    The 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

    #402348
    Dov

    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 post

    2. 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?

    #402663
    Leo
    Staff
    Customer Support

    If 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; ?>
Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.