1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to add code to head section of the pages?

Discussion in 'Drupal' started by WebDev Solutions, Apr 20, 2015.

  1. #1
    Hi,

    Our website: http://fioriflowers.co.uk/
    Code (markup):
    I have never worked with Drupal before so please if any responses could keep that in mind.
    SEMrush
    We are looking to make a mobile friendly version of our website, and need to add some code to the head section of the pages.

    The problem we are having is we can't find where the pages are kept on the server? We simply need to know how to access and edit the head section of the pages, ideally via FTP/cpanel?

    Any responses would be gratefully received.

    WebDev
     
    WebDev Solutions, Apr 20, 2015 IP
    SEMrush
  2. votevs

    votevs Active Member

    Messages:
    102
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #2
    You can copy html.tpl.php file from drupal/modules/system/ directory to your theme directory then manually add your code. Another way is to find a module that adds the code to the head section.
     
    votevs, Apr 25, 2015 IP
  3. John Dave

    John Dave Active Member

    Messages:
    874
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    80
    #3
    Place your code in a new .js file and add the line

    scripts[] = myscript.js
    This will add myscript.js to the head section.
     
    John Dave, May 8, 2015 IP
  4. Stebenkov

    Stebenkov Active Member

    Messages:
    3
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #4
    Likely need to modify this file: /sites/all/themes/{your_theme}/html.tpl.php
     
    Stebenkov, Aug 10, 2015 IP