Support » Theme: GeneratePress » Problem edit FOOTER.PHP

  • Resolved milhori

    (@milhori)



    First, congratulations and the theme is fantastic.
    I am currently using the “free” version, but will migrate to “premium”
    I live in Brazil, and I put some routines (I’m developing a website for my activity that is insurance).
    I put it in FOOTER.PHP, routines for the ContactForm form.
    However, yesterday were no longer recorded, that is, getting my routine without the consistencies made, they were working perfectly.
    When trying to reinclude the routines, the error presented (written in Portuguese).
    Não foi possível se comunicar com o site para verificar possíveis erros fatais e, por isso, a mudança no PHP foi desfeita. Você precisará enviar o arquivo PHP alterado de outra forma, como através de SFTP, por exemplo.

    I’m developing in WordPress, hosted HostGator.

    I await directions and THANK YOU VERY MUCH.

    Example of routine found in FOOTER.PHP
    function lettersOnly(evt) {
    evt = (evt) ? evt : event;
    var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode :
    ((evt.which) ? evt.which : 0));
    if (charCode > 31 && (charCode < 65 || charCode > 90) &&
    (charCode < 97 || charCode > 122)) {
    alert(“Enter letters only.”);
    return false;
    }
    return true;
    }

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Theme Author Tom

    (@edge22)

    Hi there,

    Does it work without that code being added? That code is javascript, so it should be added inside a <script> element like this:

    <script>
        Your JS here
    </script>

    Is that how you’re adding it?

    Thanks for the reply. Yes, I added. But the problem is not saving, looping (saving changes). I did several tests, without success.
    Please, I await directions.
    Thank you.

    At time … I made the attempt to test in header.php, and also not complete, getting into looping.

    The msg is the same “Algo deu errado e sua alteração pode não ter sido salva. Tente novamente. Há também uma chance de que você precise corrigir e enviar o arquivo manualmente por FTP.” — Translating: Something went wrong and your change may not have been saved. Try again. There is also a chance that you will have to fix and send the file manually via FTP ..

    As said are routines for “ContactForm7”

    Thank you very much.

    Theme Author Tom

    (@edge22)

    Try adding this function instead:

    add_action( 'wp_footer', 'tu_add_footer_scripts' );
    function tu_add_footer_scripts() {
        ?>
        <script>
            Your JS here
        </script>
        <?php
    }

    It can be added using one of these methods: https://docs.generatepress.com/article/adding-php/

    Tks !!

    Theme Author Tom

    (@edge22)

    You’re welcome 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.