Question

So when I opened wordpress on my localhost server today there is a "?>" on a white line on the top of the screen, just below the wordpress toolbar, it also shows up on my website above the header...(i need 10 rep points to post screenshot sorry)

What causes that and how can i fix it?

Thank you.

UPDATE: This is what my header.php looks like, i can't find any errors here.

<html>
<head>
<title>LoLSearch</title>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css"   media="screen" />
</head>
<body>
<div id="container">
<div id="header">
    <div class="header-content"style="width:1100px; margin:0 auto;">

        <div id="logo">
            <a id="link-logo" href="http://localhost/wordpress/"></a>
        </div>
        <div id="register">
            <a class="link" href="http://localhost/wordpress/register"></a>
        </div>
        <div id="sep">
        </div>
        <div id="login">
        </div>
        <div id="sep2">
        </div>
        <div id="contact">
            <a class="link" href="http://localhost/wordpress/contact"></a>
        </div>
    </div>
</div>

The page source for my website looks the same but with an "?>" character on the first line, which cannot be found in the header.php code

Was it helpful?

Solution

It's a left over PHP tag. Did you modify any files when moving the site to localhost? The tag alone is too generic to suggest a fix so can you tell me what you've changed recently?

OTHER TIPS

You need to view the page source and see where that ?> is being introduced in source, and the locate it in the header.php file in your theme. The ?> is the closing string of a php function, and there is either a code error in the theme that is causing a function not to execute, or an extra and unneeded ?> that is getting dumped as text.

Deactivate all plugins and see if that makes a difference. Switch to the default WP theme for a moment and check.

Use Firebug with Firefox, or use the developer tools in Chrome or Safari or IE to examine the theme source code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top