Title: Edit the header.php
Last modified: August 21, 2016

---

# Edit the header.php

 *  [ibragimof](https://wordpress.org/support/users/ibragimof/)
 * (@ibragimof)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/edit-the-headerphp/)
 * I can not edit the file header.php in wp-content\themes\my
    my code
 *     ```
       $url = 'http://...........';
       $start = '<div class="marquee">';
       $finish = '<div class="row-fluid" id="content">';
       function parser($url,$start,$finish) {
           $content = file_get_contents($url);
           $position1 = strpos($content, $start);
           $position2 = strpos($content, $finish);
           $content = substr($content, $position1, $position2-$position1);
           $content = $content;
           echo ($content);
           return $content;
       }
   
       parser($url, $start, $finish);
       ```
   
 * if i put this code to header.php, my site don’t work

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/edit-the-headerphp/#post-4764179)
 * Be sure you enter this after the `<body>` tag of your header.php. The content
   echoed alone appears to be inappropriate for `<head>` section. I don’t know what
   content you’re getting, but I inserted your code in my header.php file with `
   $start.$url.$finish` assigned to $content instead of getting contents — it didn’t
   cause any problems, the “URL” string was merely inserted in my site, so there
   doesn’t appear to be anything wrong with the code itself.

Viewing 1 replies (of 1 total)

The topic ‘Edit the header.php’ is closed to new replies.

## Tags

 * [edit](https://wordpress.org/support/topic-tag/edit/)
 * [header.php](https://wordpress.org/support/topic-tag/header-php/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/edit-the-headerphp/#post-4764179)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
