• Resolved liftyourgame

    (@liftyourgame)


    Is there a way to add html/js code to the footer right next to the GeneratePress copyright message on the free version? I tried manually editing functions.php in appearance > editor but this made a new line below the #222222 bar at the bottom for the script. If I placed the code higher it put in on the footer widgets instead. How can I place it next to the copyright message?

    Thanks!

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

    (@edge22)

    Hi there,

    Try adding this function:

    add_action( 'generate_credits', 'tu_add_footer_js' );
    function tu_add_footer_js() { ?>
        Javascript in here
    <?php }

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    Let me know if you need more info ??

    Thread Starter liftyourgame

    (@liftyourgame)

    Thanks so much!

    One more thing, how do I get that nice space with the bullet point to the right of the GeneratePress anchor link? In this code:

    `if ( ! function_exists( ‘generate_add_footer_info’ ) ) :
    add_action(‘generate_credits’,’generate_add_footer_info’);
    function generate_add_footer_info()
    {
    $copyright = sprintf( ‘<span class=”copyright”>© %1$s</span> • %3$s‘,
    date( ‘Y’ ),
    esc_url( ‘URL’ ),
    __( ‘Site Name’,’Site Name’ )
    );

    echo apply_filters( ‘generate_copyright’, $copyright );
    }
    endif;

    I can’t figure out what makes the ” ? “. What do I need to do?

    Thanks

    EDIT: this site seems to have translated some of the code I pasted to create a copyright symbol and a bullet point. However I’m still not entirely sure what code I need to duplicate to achieve the same result on the right of the Generatepress URL.

    • This reply was modified 6 years, 12 months ago by liftyourgame.
    Theme Author Tom

    (@edge22)

    Hi there,

    Try this: &bull;

    Thread Starter liftyourgame

    (@liftyourgame)

    That did it, thanks again!

    Theme Author Tom

    (@edge22)

    You’re welcome ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adding a JS script to the footer’ is closed to new replies.