• How can I display full html code in edit? I need to display the closing </head> tag so that I can place the Google analytics tracking code snippet correctly.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Your closing </head> tag is likely to be in a template file: header.php

    Some themes allow you to edit the template files from the dashboard although if you do it that way, you run the risk of losing the edit when the theme is updated.

    You can use a child theme or there’s probably a plugin to do exactly what you want if you search the repository.

    Thread Starter dolle

    (@dolle)

    Hi Martcol,

    Thank you so much for your reply. I see the </head> tag in the template file:header.php (in Appearances).

    Now my question is: can I safely paste the tracking code snippet directly in this template file?

    David

    Well, David,

    I think so.

    If you do this in a child theme, copy your header.php file to the child theme folder and paste your code in where the instructions indicate.

    If it goes horribly wrong, you can sort it out by deleting that theme file using FTP access and WordPress will default to using the parent theme header.php again.

    If you are really nervous about trying this you know, you can get a plugin to do it for you.

    If you want to have a go at it, then make sure you back your site up first. Always back it up!

    I used the “Google Analytics Dashboard for WP” plugin and it put the tracking code in the header for me. No need to edit php.

    I’ve seen sites where the tracking code is after the footer and that seems to work OK.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘edit in html view’ is closed to new replies.