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.

Installing Script Onto An Existing Wordpress Site

Discussion in 'PHP' started by steveb, Feb 10, 2013.

  1. #1
    Hi guys,

    I'm trying to stall a php script onto my existing Wordpress site, but I'm having trouble applying the Wordpress theme to the the script.

    The script has a javascript code that runs in the head section, so it's a little tricky. I've tried the include function for the head and footer, but it doesn't work and gives me errors.
    SEMrush
    Example:
    <?php include("http://www.domain.com/wp-content/themes/theme-name/header.php"); ?>
    PHP:
    Any advice would be helpful.

    Thanks,
    Steve
     
    steveb, Feb 10, 2013 IP
    SEMrush
  2. Mike In

    Mike In Active Member

    Messages:
    244
    Likes Received:
    5
    Best Answers:
    2
    Trophy Points:
    90
    #2
    Not sure, If I am on Point.

    But try to put the script in the header.php file of the theme you are using.

    if the header file is tooooooo meshed up, try to search for plugin that could do the job for you (i hope you will find one).

    Regards.
     
    Mike In, Feb 10, 2013 IP
  3. gavo

    gavo Active Member

    Messages:
    123
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    70
    #3
    There may be a conflict with another js file.

    Try putting your .js just before </head> in header.php

    Or link to your site and file so we can look.
     
    gavo, Feb 11, 2013 IP
  4. freelanceinphp

    freelanceinphp Member

    Messages:
    134
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    48
    #4
    What errors are you facing, please confirm that errors should not exist in domain.com header file
     
    freelanceinphp, Feb 12, 2013 IP
  5. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #5
    Is header.php actually creating HTML for a page header? (If you can't answer that you'll need to hire a programmer to make your script work.)
     
    Rukbat, Feb 12, 2013 IP
  6. steveb

    steveb Well-Known Member

    Messages:
    1,434
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    175
    #6
    Thanks for all the responses guys. I found a solution that does not require me to mess around with the coding.
     
    steveb, Feb 12, 2013 IP