...

View Full Version : cannot validate my website



jarv
05-30-2012, 03:22 PM
hi,

I have tried validating my website and found 14 errors

1 error said: No XML declaration (e.g <?xml version="1.0"?>) could be found at the beginning of the document.

so I added <?xml version="1.0"?> at the top of the page underneath the doctype and the website disapeared?!

here's my site: http://apl.inpreview.net/

Please help?

thanks

tracknut
05-30-2012, 03:42 PM
I'm not seeing a doctype at the top of the page... it starts with some javascript. That definitely needs fixing, and is the source for most of the issues.

Dave

jarv
05-30-2012, 03:50 PM
I think the DOCTYPE is lower down, if I put doctype at the top and XML="ENG" etc this breaks teh page and goes all blank,

source code only shows bit of JavaScript

jarv
05-30-2012, 03:53 PM
ok, I just put <?xml version="1.0"?> in on the 2nd line and the site has gone

tracknut
05-30-2012, 03:58 PM
You don't need the XML line in there... the validator is saying that it can't figure out the parse model for the document (i.e. can't figure out what language it's written in), because it can't find a doctype, OR an XML description OR anything else to help it figure it out. So you need the doctype as the first line, not the JS.

Dave

jarv
05-30-2012, 04:04 PM
But I have a DOCTYPE in my header.php of my wordpress theme



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes() ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title><?php if (is_front_page()) { ?><?php bloginfo('name'); ?><?php } else { ?><?php wp_title($sep = ''); ?> - <?php bloginfo('name'); ?><?php } ?></title>
<meta http-equiv="content-type" content="<?php bloginfo('html_type') ?>; charset=<?php bloginfo('charset') ?>" />
<meta name="description" content="<?php bloginfo('description') ?>" />
<?php if(is_search()) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php }?>

<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />
<link href="<?php bloginfo('template_url'); ?>/library/styles/custom/<?php echo strtolower(get_option('theme_color')); ?>.css" media="screen" rel="stylesheet" type="text/css" />
<link rel="alternate" type="application/rss+xml" href="<?php bloginfo('rss2_url') ?>" title="<?php echo wp_specialchars(get_bloginfo('name'), 1) ?> <?php _e('Posts RSS feed', 'thematic'); ?>" />
<link rel="alternate" type="application/rss+xml" href="<?php bloginfo('comments_rss2_url') ?>" title="<?php echo wp_specialchars(get_bloginfo('name'), 1) ?> <?php _e('Comments RSS feed', 'thematic'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url') ?>" />


<?php wp_head() ?>


<!--[if lt IE 7]>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/library/scripts/unitpngfix.js"></script>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/library/styles/hacks/ieonly.css" />
<![endif]-->

<!--[if lte IE 6]><link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/library/styles/hacks/ie6.css" /><![endif]-->
<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/library/styles/hacks/ie7.css" /><![endif]-->
<!--[if lte IE 8]><link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/library/styles/hacks/ie8.css" /><![endif]-->


<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/library/scripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/library/scripts/jquery.pngFix.pack.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/library/scripts/jquery.prettyPhoto.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/library/scripts/cufon-yui.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/library/scripts/avenir.font.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/library/scripts/shapeshifter.js"></script>


<?php if (get_option('theme_cu3er') == 'Yes') { ?>
<!-- Cu3er 3D block scripts -->
<?php $config_url = get_bloginfo('template_url').'/library/cu3er/config_shapeshifter.xml'; ?>
<script type="text/javascript" src="<?php echo get_bloginfo('template_url'); ?>/library/cu3er/js/swfobject/swfobject.js"></script>
<script type="text/javascript">
var flashvars = {};
flashvars.xml = "<?php echo $config_url; ?>";
flashvars.font = "<?php echo get_bloginfo('template_url'); ?>/library/cu3er/font.swf";
var attributes = {};
attributes.wmode = "transparent";
attributes.id = "slider";
swfobject.embedSWF("<?php echo get_bloginfo('template_url'); ?>/library/cu3er/cu3er.swf", "cu3er-container", "590", "300", "9", "expressInstall.swf", flashvars, attributes);
</script>
<?php } else {} ?>


<style type="text/css">
<!--
#cu3er-container {width:590px; outline:0;}
-->
</style>


<!--[if lte IE 8]>
<style type="text/css">
<!--
#content { padding-top: 182px !important; }
.content_block { padding-bottom: 300px !important; }
-->
</style>
<![endif]-->


<!-- Open/Close scripts -->
<script type="text/javascript">
$(document).ready(function(){

//Switch the "Open" and "Close" state per click
$("#trigger").toggle(function(){
$(this).addClass("active");
}, function () {
$(this).removeClass("active");
});

//Slide up and down on click
$("#trigger").click(function(){
$(this).next("#footer").slideToggle("slow");
});

});
</script>


<style type="text/css">
<?php echo get_option('theme_customcss'); ?>
</style>

</head>

<body <?php if(is_category('8')) echo ' id="contentblog"'; ?>>
<? if ( ! empty( $GLOBALS['template'] ) && basename( $GLOBALS['template'] ) == 'archives.php' )
echo 'Something that appears on the template file archives.php';?>

<div id="global_wrapper">

<div id="sidebar">
<h1 class="logo">
<a href="#home"><img src="<?php echo get_option('theme_logo',true); ?>" alt="<?php bloginfo('name'); ?>" width="153" height="67" /></a>
</h1>





<!-- Navigation -->
<ul id="navigation">
<?php wp_nav_menu( array('menu' => 'Main Menu' )); ?>
</ul>
<!-- end Navigation-->


</div>

tracknut
05-30-2012, 04:12 PM
There must be some WP configuration issue I suppose, and unfortunately I know nothing about WP. That header.php is not the first thing that gets spit out when you visit your web site. Your site starts with:


<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#content ul.photos li").eq(-2).css("padding-bottom", "0px");
$("#content ul.photos li").eq(-1).css("padding-bottom", "0px");
});
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head profile="http://gmpg.org/xfn/11">

...


I don't know what file that's coming from, probably index.php I'll guess, not header.php

Dave



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum