• I would like to put the code from my advertising network. I need to put the code just below <body> but when I do that code just disappears. could you please guide me how to do it. thank you.

    • This topic was modified 4 years, 1 month ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 26 total)
  • hey @jp123,

    Can you please tell us how you’re adding code after the <body> tag? Are you editing PHP files or using plugins or using hooks?

    Best,
    Vijay

    Thread Starter jp123

    (@jp123)

    I’m trying to add code from propellerads.

    1st I tried add code at appearance then theme file editor after that header.php then I put the code just below <body> then saved file. I tried few theme but did not work.

    2nd propellerads has plugin and I set up all correct but ad code not showing up on my site.

    I asked propellerads support and they checked but could not find solution and they asked me to ask wordpress support.

    Vijay Hardaha

    (@vijayhardaha)

    Hey @jp123

    I can see you’re using twentytwelve theme, so when you’re editing header.php make sure you’re editing the correct theme file.

    <body <?php body_class(); ?>>
    <?php wp_body_open(); ?>

    You’ll find code like this, in the header.php and you can put your code before <?php wp_body_open(); ?> line and save the changes.

    However, there are many reasons that your code not showing after the body tag.

    1. Cache/Optimization plugins remove or modify some js script codes.
    2. Cache/Optimization plugins put all the js code at the bottom of the page.

    if you’re putting the code, I suggested disabling the cache plugin and then putting the code and checking if it works.

    Note: I highly suggest creating a backup before making any changes to settings or editing files.

    Best,
    Vijay

    Thread Starter jp123

    (@jp123)

    I have disabling the cache plugin and placed the code but still not working.
    I put the code then click save then it said success, but when I go back to see the header.php file again the code I just put is gone and leaves empty space in there.

    any other suggestion? thank you for your help.

    Vijay Hardaha

    (@vijayhardaha)

    Can you send a screenshot of the code that you’re trying to add?

    Note: Blur/Hide any information in the screenshot that shouldn’t be shared in public.

    Thread Starter jp123

    (@jp123)

    Vijay Hardaha

    (@vijayhardaha)

    I have tried to add similar js code via theme editor. The code was showing properly.

    Can you try editing via FTP?

    Thread Starter jp123

    (@jp123)

    I tried with FTP but still the same, code just disappears…

    Vijay Hardaha

    (@vijayhardaha)

    That’s strange, Can you confirm file transfer was successful after making changes in the file via FTP?

    And do you have any security plugins installed?

    Thread Starter jp123

    (@jp123)

    yes I am sure file transfer was successful.

    no security plugins installed

    Thread Starter jp123

    (@jp123)

    how about permission things matter?

    http://tsuyoshisuzuki.com/images/code2.png

    it set as writable right?

    Vijay Hardaha

    (@vijayhardaha)

    Permission looks ok, 644 is for files and 755 for folders/directories.

    Can you edit the file and save changes, then note the last modified timestamp and check the website if changes are loading or not.

    check refresh the FTP and not the last modified again and see if there is any change in the last modified?

    Thread Starter jp123

    (@jp123)

    yes last modified timestamp update to now but code still disappears

    Thread Starter jp123

    (@jp123)

    ad network recommended to me to place the code in widgets.
    when I try to save it it get error below.

    http://tsuyoshisuzuki.com/images/code3.png

    somehow my site is not saving the code on my site.

    plugin, widgets or directly put code all the code I put keep disappearing after few secounds.

    maybe some setting of my site is auto deleting the code?

    Vijay Hardaha

    (@vijayhardaha)

    maybe some setting of my site is auto deleting the code?

    You can try to contact your hosting support and find out if they have any security thing running on a server or on WordPress that could cause something like this.

Viewing 15 replies - 1 through 15 (of 26 total)

The topic ‘placing code from advertising network’ is closed to new replies.