Adding a JS script to the footer
-
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!
-
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 🙂
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 8 years, 5 months ago by
liftyourgame.
Hi there,
Try this:
•That did it, thanks again!
You’re welcome 🙂
-
This reply was modified 8 years, 5 months ago by
The topic ‘Adding a JS script to the footer’ is closed to new replies.
