Nyt tuli mielenkiintoinen ongelma WP:n kanssa.
header.php
<!DOCTYPE html> <html lang="fi"> <head> <meta charset="utf-8" /> <title><?php wp_title(); ?></title> <link rel="stylesheet" type="text/css" href="<?php get_stylesheet_uri(); ?>/css/reset.css" /> <link rel="stylesheet" type="text/css" href="<?php get_stylesheet_uri(); ?>/css/text.css" /> <link rel="stylesheet" type="text/css" href="<?php get_stylesheet_uri(); ?>/css/style.css" /> <link rel="stylesheet" type="text/css" href="<?php get_stylesheet_uri(); ?>/css/960_16_col.css" /> <?php wp_head(); ?> </head> <body> <div class="container_16">
front-page.php
<?php get_header(); the_post(); ?> <h1><?php the_title();?></h1> <?php the_content(); ?> <?php get_footer(); ?>
Kun katson esim. Firefoxissa lähdekoodia menee näin
<!DOCTYPE html>
<html lang="fi">
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="/css/reset.css" />
<link rel="stylesheet" type="text/css" href="/css/text.css" />
<link rel="stylesheet" type="text/css" href="/css/style.css" />
<link rel="stylesheet" type="text/css" href="/css/960_16_col.css" />
<meta name='robots' content='noindex,nofollow' />
<link rel="alternate" type="application/rss+xml" title="WP teemojen testaaminen » Sample Page Comments Feed" href="http://localhost/wpthemetester/sample-page/feed/" />
<link rel='stylesheet' id='admin-bar-css' href='http://localhost/wpthemetester/wp-includes/css/admin-bar.min.css?ver=3.5.1' type='text/css' media='all' />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://localhost/wpthemetester/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://localhost/wpthemetester/wp-includes/wlwmanifest.xml" />
<link rel='next' title='Testi sivu' href='http://localhost/wpthemetester/testi-sivu/' />
<meta name="generator" content="WordPress 3.5.1" />
<link rel='canonical' href='http://localhost/wpthemetester/' />
<style type="text/css" media="print">#wpadminbar { display:none; }</style>
<style type="text/css" media="screen">
html { margin-top: 28px !important; }
* html body { margin-top: 28px !important; }
</style>
</head>
<body>
<div class="container_16">ja ainakin Firebugissa ja IExplorerin developer toolssissa näyttää tältä..
<html lang="fi"> <head></head> <body class=" customize-support"> <meta charset="utf-8"> <title></title> <link href="/css/reset.css" type="text/css" rel="stylesheet"> <link href="/css/text.css" type="text/css" rel="stylesheet"> <link href="/css/style.css" type="text/css" rel="stylesheet"> <link href="/css/960_16_col.css" type="text/css" rel="stylesheet"> <meta content="noindex,nofollow" name="robots"> <link href="http://localhost/wpthemetester/sample-page/feed/" title="WP teemojen testaaminen » Sample Page Comments Feed" type="application/rss+xml" rel="alternate"> <link id="admin-bar-css" media="all" type="text/css" href="http://localhost/wpthemetester/wp-includes/css/admin-bar.min.css?ver=3.5.1" rel="stylesheet"> <link href="http://localhost/wpthemetester/xmlrpc.php?rsd" title="RSD" type="application/rsd+xml" rel="EditURI"> <link href="http://localhost/wpthemetester/wp-includes/wlwmanifest.xml" type="application/wlwmanifest+xml" rel="wlwmanifest"> <link href="http://localhost/wpthemetester/testi-sivu/" title="Testi sivu" rel="next"> <meta content="WordPress 3.5.1" name="generator"> <link href="http://localhost/wpthemetester/" rel="canonical"> <style media="print" type="text/css"> <style media="screen" type="text/css"> <div class="container_16">
Yritin tuota HTML:ää katsella, mutta en löytänyt syytä, miksi Firebugissa ja Developer tool:ssa <head>:iin tarkoitetut tiedot menee <body>:n sisään? Pistin tuon html:n html-validaattoriin, eikä ongelmia ollut. Mikähän tässä voisi mättää, vai mättääkö kuitenkaan mikään?
Silmiin pisti tuo body-tagiin lisääntyvä customize-support-luokka. Googlen hakutulosten perusteella joku WordPressin purkkaominaisuus. Eiköhän kaikki muutkin dom-muutokset sillä selviä.
Nyt selvisi syy. Olen kirjoitellut nämä kaikki tiedostot Notepad++:lla. Encodingina oli utf-8. Muutin encodingiksi "utf-8 without BOM" ja kaikki rupes tippumaan oikeille paikoille. Onneksi ei kauaa tarvinnut tämänkin kanssa takuta. :)
Aihe on jo aika vanha, joten et voi enää vastata siihen.