Site logo

Archived topic

updating link in footer after theme update

3 replies · Started by Anonymous on June 28, 2015

Viewing posts 1–4 of 4

Every time the theme is updated I have been manually inserting <script src="//nht-2.extreme-dm.com/t.js" id="eX-wurzel-2" async defer></script> into the footer so that my stats package can record visitor details.

I have been using the GeneratePress Child theme but with my limited programming skills I don't know if it's possible to put a line of code in the child theme to save me having to manually update the footer file every time the theme is updated.

I have tried just inserting the code above on it's own but that won't work so I assume that I need to do something else.

Still loving the theme which I'm using on my blog http://factoringblog.co.uk/ and would like to point out to others that it's a great theme for anyone with limited Wordpress skills

Hi Ian,

Do you have GP Hooks? If so, you can place it into the wp_footer hook in "Appearance > GP Hooks".

If not, you could do something like this:

add_action( 'wp_footer','generate_add_script' );
function generate_add_script()
{
?>
      Your script in here
<?php
}

Adding PHP: http://generatepress.com/knowledgebase/adding-php-functions/

I did buy the set of extras but with my lack of technical nous I've never used the Hooks as I didn't know what it did but having followed your instructions it has worked a dream.

Many thanks Tom.

Glad I could help :)

This archived topic is closed to new replies.