Support » Plugins and Hacks » Hacks » Edit the header.php

  • 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

    (@bcworkz)

    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.