Close

Account

Documentation

Forum

Menu

PHP in functions.php not working?

  • Post count: 8
    anon
    June 11, 2017 at 10:22 am #23939

    I have put the following PHP in my child theme functions.php file (I use the Popup Maker plugin, by the way):

    <?php
    add_action( ‘wp_footer’, ‘hoc_popup_reg_form_check’, 1000 );
    function hoc_popup_reg_form_check() {
    if ( isset( $_POST[‘usp_form_submit’] ) && $_POST[‘usp_form_submit’] == ‘fffa54b401’ ) {
    ?>
    <script type=”text/javascript”>
    jQuery(‘#popmake-722’).popmake(‘open’);
    </script>
    <?php
    }
    }
    ?>

    The code above is supposed to automatically relaunch a popup of a form (which is in a popup) after a form submit and subsequent redirect so that users can see the “success” message.

    I believe that the code is correct (including variable names and values).

    However, when I visit my site’s home page (or any other page, for that matter), I don’t see any reference to that function and/or javascript in the page’s source code.

    At the very least, I thought I would see the following somewhere in the page source code:

    <script type=”text/javascript”>
    jQuery(‘#popmake-722’).popmake(‘open’);
    </script>

    Regardless, when I submit the form (which is via popup), the submission works perfectly fine, but then nothing happens (i.e., the popup doesn’t automatically relaunch with the “success” message).

    FYI, I am using a blog masonry format on my home page (not sure if that matters).

    Any thoughts?

    Post count: 5922
    Adek
    June 12, 2017 at 1:41 am #23942

    Hi anon,

    Unfortunately, this is not our support area. For more detail please visit our Support Policy right here http://support.jegtheme.com/support-policy/

    If you interest you can use our Custom Service right here http://support.jegtheme.com/custom-change-service/

    Let us know if you have further question.

    Thank you

You must be logged in to reply to this topic.