Web Hosting Talk







View Full Version : 59 errors in my wordpress blog


sash_007
12-18-2009, 07:59 AM
Hello friends
I am getting 59 error (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.neophytech.com%2Fblog%2F&charset=%28detect+automatically%29&doctype=Inline&group=0&st=1&user-agent=W3C_Validator%2F1.654)s in my wordpress blog can anyone fix this
Archives.php



<?php get_header(); ?>

<div id="contentwrapper"><div id="content">

<?php if (have_posts()) : ?>

<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>

<?php /* If this is a category archive */ if (is_category()) { ?>
<h2 class="pageTitle">Archive for the ‘<?php single_cat_title(); ?>’ Category</h2>
<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
<h2 class="pageTitle">Posts Tagged ‘<?php single_tag_title(); ?>’</h2>
<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
<h2 class="pageTitle">Archive for <?php the_time('F jS, Y'); ?></h2>
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<h2 class="pageTitle">Archive for <?php the_time('F, Y'); ?></h2>
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<h2 class="pageTitle">Archive for <?php the_time('Y'); ?></h2>
<?php /* If this is an author archive */ } elseif (is_author()) { ?>
<h2 class="pageTitle">Author Archive</h2>
<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h2 class="pageTitle">Blog Archives</h2>
<?php } ?>

<?php while (have_posts()) : the_post(); ?>

<div class="post">
<h2 class="postTitle"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<div class="postMeta">Filed in <?php the_category(', '); ?> on <?php the_time('M.d, Y') ?></div>
<div class="postContent"><?php the_excerpt('(Read the rest of this entry...)'); ?></div>
<p class="comments"><?php comments_popup_link('Leave a Comment', 'Comments (1)', 'Comments (%)'); ?></p>
</div> <!-- Closes Post -->

<?php endwhile; ?>

<div id="nextprevious">
<div class="left"><?php posts_nav_link('','','&laquo; previous entries') ?></div>
<div class="right"><?php posts_nav_link('','next entries &raquo;','') ?></div>
<div class="cleared"></div>
</div>

<?php else : ?>

<div class="post">
<h2 class="postTitle">Not Found</h2>
<p>Sorry, but you are looking for something that isn't here.</p>
</div> <!-- Closes Post -->

<?php endif; ?>

</div></div> <!-- Closes Content -->

<?php get_sidebar(); ?>

<div class="cleared"></div>

</div> <!-- Closes Main -->
<div class="bottomcurvewhite"></div>



<?php get_footer(); ?>




Comments.php



<?php // Do not delete these lines
if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');

if (!empty($post->post_password)) { // if there's a password
if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie
?>

<p class="nocomments">This post is password protected. Enter the password to view comments.</p>

<?php
return;
}
}

/* This variable is for alternating comment background */
$oddcomment = 'class="alt" ';
?>

<!-- You can start editing here. -->

<?php if ($comments) : ?>
<h3 id="comments"><?php comments_number('No Responses', 'One Response', '% Responses' );?> to “<?php the_title(); ?>”</h3>

<ol class="commentlist">

<?php foreach ($comments as $comment) : ?>

<li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">
<cite><?php comment_author_link() ?></cite> Says:
<?php if ($comment->comment_approved == '0') : ?>
<em>Your comment is awaiting moderation.</em>
<?php endif; ?>



<small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('F jS, Y') ?> at <?php comment_time() ?></a> <?php edit_comment_link('edit','&nbsp;&nbsp;',''); ?></small>

<?php comment_text() ?>

</li>

<?php
/* Changes every other comment to a different class */
$oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : '';
?>

<?php endforeach; /* end for each comment */ ?>

</ol>

<?php else : // this is displayed if there are no comments so far ?>

<?php if ('open' == $post->comment_status) : ?>
<!-- If comments are open, but there are no comments. -->

<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="nocomments">Comments are closed.</p>

<?php endif; ?>
<?php endif; ?>


<?php if ('open' == $post->comment_status) : ?>

<h3 id="respond">Leave a Reply</h3>

<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</p>
<?php else : ?>

<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">

<?php if ( $user_ID ) : ?>

<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Logout &raquo;</a></p>

<?php else : ?>

<p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
<label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label></p>

<p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
<label for="email"><small>Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label></p>

<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
<label for="url"><small>Website</small></label></p>

<?php endif; ?>

<!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>-->

<p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>

<p><input name="submit" type="submit" id="submit" tabindex="5" value="" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
</p>
<?php do_action('comment_form', $post->ID); ?>

</form>

<?php endif; // If registration required and not logged in ?>

<?php endif; // if you delete this the sky will fall on your head ?>



Footer.php

<div id="footer">

<div id="credits">
<p><?php the_time('Y'); ?> <?php bloginfo('name'); ?>. <?php if(is_home()) : ?><p class="fl c3">&copy; 2009 Neophytech web design &amp; hosting Company.All rights reserved <a href="#" class="c1">Terms of service</a><span class="c2">|</span><a href="#" class="c1">Privacy policy</a></p><?php endif; ?></p>

<div class="cleared"></div>

</div> <!-- Closes Credits -->
</div> <!-- Closes Footer -->
</div> <!-- Closes Wrapper -->
</body>
</html>




Header.php



<!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">

<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php if (is_home () ) { bloginfo(�name�); }
elseif ( is_category() ) { single_cat_title(); echo ' - ' ; bloginfo(�name�); }
elseif (is_single() ) { single_post_title();}
elseif (is_page() ) { single_post_title();}
else { wp_title(��,true); } ?></title>
<meta name="robots" content="index,follow" />


<meta name="google-site-verification" content="Ln2evZK7ZjqvB7xgFvLmP0gHf1cGzCjIe1KKvOQW0w8" />
<meta name="verify-v1" content="kb69oTiAXXkrEREN8DuuCQDRYmCajiZj8i0ipuNfyw8=" />
<meta name="author" content="Neophytech Team" />
<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<link rel="icon" type="image/x-ico" href="<?php bloginfo('template_url'); ?>/images/favicon.ico" />
<?php wp_head(); ?>
</head>

<body>
<div id="wrapper">

<div id="header">
<div class="topright"><!-- Edit welcome message here -->Welcome to Neophytech! Here you can you can learn and discuss everything on web and graphics. <a href="<?php echo get_option('home'); ?>">Learn more about us &raquo;</a>

</div>
<h1 class="sitename"><a href="<?php echo get_option('home'); ?>"><?php bloginfo('name'); ?></a></h1>
<h2 class="sitedesc"><?php bloginfo('description'); ?></h2>
</div> <!-- Closes Header -->

<div id="nav">

<div class="search"><?php include (TEMPLATEPATH . '/searchform.php'); ?></div> <!-- Closes Search -->

<?php function get_the_pa_ges() {
global $wpdb;
if ( ! $these_pages = wp_cache_get('these_pages', 'pages') ) {
$these_pages = $wpdb->get_results('select ID, post_title from '. $wpdb->posts .' where post_status = "publish" and post_type = "page" order by ID');

}
return $these_pages;
}

function list_all_pages(){

$all_pages = get_the_pa_ges ();
foreach ($all_pages as $thats_all){
$the_page_id = $thats_all->ID;

if (is_page($the_page_id)) {
$addclass = ' class="current_page"';
} else {
$addclass = '';
}
$output .= '<li' . $addclass . '><a href="'.get_permalink($thats_all->ID).'" title="'.$thats_all->post_title.'"><span>'.$thats_all->post_title.'</span></a></li>';
}

return $output;
}
?>
<ul>
<?php

if (is_home()) {
$addclass = ' class="current_page"';
} else {
$addclass = '';
}
echo "<li" . $addclass . "><a href='" . get_option('home') . "' title='Home'><span>Home</span></a></li>";
echo list_all_pages();?>
</ul>

<div class="cleared"></div>
</div> <!-- Closes Nav -->


<div class="topcurvewhite"></div>
<div id="blog"><h2>Our Blog</h2></div>
<div id="main">


index.php



<?php get_header(); ?>

<div id="contentwrapper"><div id="content">

<?php if (have_posts()) : ?>

<?php while (have_posts()) : the_post(); ?>

<div class="post">
<h2 class="postTitle"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<div class="postMeta">Filed in <?php the_category(', '); ?> on <?php the_time('M.d, Y') ?></div>
<div class="postContent"><?php the_content('[Read the rest of this entry...]'); ?></div>
<p class="comments"><?php comments_popup_link('Leave a Comment', 'Comments (1)', 'Comments (%)'); ?></p>
</div> <!-- Closes Post -->

<?php endwhile; ?>

<?php else : ?>

<div class="post">
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>
</div> <!-- Closes Post -->

<?php endif; ?>

<div id="nextprevious">
<div class="left"><?php posts_nav_link('','','&laquo; previous entries') ?>&nbsp;&nbsp;</div>
<div class="right"><?php posts_nav_link('','next entries &raquo;','') ?></div>
</div>

</div></div> <!-- Closes Content -->

<?php get_sidebar(); ?>

<div class="cleared"></div>

</div> <!-- Closes Main -->

<?php get_footer(); ?>




page.php

<?php get_header(); ?>

<div id="contentwrapper"><div id="content">

<?php if (have_posts()) : ?>

<?php while (have_posts()) : the_post(); ?>

<div class="post">
<h2 class="postTitle"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<div class="postContent"><?php the_content('(Read the rest of this entry...)'); ?></div>
<p class="comments"><?php comments_popup_link('Leave a Comment', 'Comments (1)', 'Comments (%)'); ?></p>
</div> <!-- Closes Post -->

<?php endwhile; ?>

<?php else : ?>

<div class="post">
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>
<div class="search">
<?php include (TEMPLATEPATH . "/searchform.php"); ?>
</div> <!-- Closes Search -->
</div> <!-- Closes Post -->

<?php endif; ?>

</div></div> <!-- Closes Content -->

<?php get_sidebar(); ?>

<div class="cleared"></div>

</div> <!-- Closes Main -->
<div class="bottomcurvewhite"></div>



<?php get_footer(); ?>


sidebar.php

<div class="sidebars">

<ul>

<li class="nobg">
<a href="feed:<?php bloginfo('rss2_url'); ?>" ><img src="<?php bloginfo('template_directory'); ?>/images/subscribe.gif" alt="subscribe"></img></a>
</li>

<li class="nobg"><!-- insert 125x125 sponsor ad blocks here -->
<h2>Advertising</h2>
<a rel="nofollow" href="#"><img src="<?php bloginfo('template_directory'); ?>/images/img300.jpg" border="0" title="insert title" alt="insert title" /></a>


</li>

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar1') ) : ?>

<li>
<h2>Categories</h2>
<ul>
<?php wp_list_categories('show_count=0&title_li='); ?>
</ul>
</li>





<li>
<h2>Meta</h2>
<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></li>
<li><a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a></li>
<li><a href="http://www.neophytech.com/" title="Powered by Neophytech, Web designing,hosting company in Chandannagar.">Neophytech Team</a></li>
<?php wp_meta(); ?>
</ul>
</li>

<?php endif; ?>
</ul>

<div class="cleared"></div>
</div> <!-- Closes Sidebars -->



singlepost.php

<?php get_header(); ?>

<div id="contentwrapper"><div id="content">

<?php if (have_posts()) : ?>

<?php while (have_posts()) : the_post(); ?>

<div class="post">

<h2 class="postTitle"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<div class="postMeta">Filed in <?php the_category(', '); ?> on <?php the_time('M.d, Y') ?></div>
<div class="postContent"><?php the_content('(Read the rest of this entry...)'); ?></div>

<div class="postTags"><?php the_tags('Tags: ', ', ', ''); ?></div>

<p class="comments"><?php comments_popup_link('Leave a Comment', 'Comments (1)', 'Comments (%)'); ?></p>
</div> <!-- Closes Post -->

<div class="comment">
<?php comments_template(); ?>
</div> <!-- Closes Comments -->

<?php endwhile; ?>

<?php else : ?>

<div class="post">
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>
</div> <!-- Closes Post -->

<?php endif; ?>



</div></div> <!-- Closes Content -->

<?php get_sidebar(); ?>

<div class="cleared"></div>

</div> <!-- Closes Main -->
<div class="bottomcurvewhite"></div>



<?php get_footer(); ?>




home.php

<?php get_header(); ?>

<div id="contentwrapper"><div id="content">

<?php if (have_posts()) : ?>

<?php while (have_posts()) : the_post(); ?>

<div class="post">
<h2 class="postTitle"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<div class="postMeta">Filed in <?php the_category(', '); ?> on <?php the_time('M.d, Y') ?></div>
<div class="postContent"><?php the_content('[Read the rest of this entry...]'); ?></div>
<p class="comments"><?php comments_popup_link('Leave a Comment', 'Comments (1)', 'Comments (%)'); ?></p>
</div> <!-- Closes Post -->

<?php endwhile; ?>

<?php else : ?>

<div class="post">
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>
</div> <!-- Closes Post -->

<?php endif; ?>

<div id="nextprevious">
<div class="left"><?php posts_nav_link('','','&laquo; previous entries') ?>&nbsp;&nbsp;</div>
<div class="right"><?php posts_nav_link('','next entries &raquo;','') ?></div>
</div>

</div></div> <!-- Closes Content -->


<?php get_sidebar(); ?>

<div class="cleared"></div>

</div> <!-- Closes Main -->
<div class="bottomcurvewhite"></div>


<?php get_footer(); ?>


themefunctions.php

<?php

if ( function_exists('register_sidebar') )
register_sidebar(array(
'name'=>'sidebar1',
'before_widget' => '<li id="%1$s" class="sidebaritem">',
'after_widget' => '</li>',
'before_title' => '<h2 class="widgettitle">',
'after_title' => '</h2>',
));


//GsL98DGtpo0W


searchform.php

<form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
<div>
<input type="text" value="<?php the_search_query(); ?>" name="s" id="searchbox" />
<input type="submit" id="searchbutton" value="" />
</div>
</form>

larwilliams
12-18-2009, 09:32 AM
Most of them are related to your links. In XHTML 1.0, parameters need to be separated by &amp; not just &

Wrong way:

<a href="index.php?parameter=1&parameter2=2">This is a test</a>


Correct way:

<a href="index.php?parameter=1&amp;parameter2=2">This is a test</a>


Fixing this problem in your code should reduce the number of errors to 12 or so.

sash_007
12-18-2009, 10:12 AM
Most of them are related to your links. In XHTML 1.0, parameters need to be separated by &amp; not just &

Wrong way:

<a href="index.php?parameter=1&parameter2=2">This is a test</a>


Correct way:

<a href="index.php?parameter=1&amp;parameter2=2">This is a test</a>


Fixing this problem in your code should reduce the number of errors to 12 or so.

sorry can u be more specific i am newbie in php ?

mattle
12-18-2009, 10:20 AM
sorry can u be more specific i am newbie in php ?

This has nothing to do with PHP...try validating this code to see what sash_007 is talking about:


<!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">
<head><title/></head>
<body>
<a href="http://www.google.com/search?q=xml+syntax&ie=utf-8">Bad XML</a>
<a href="http://www.google.com/search?q=xml+syntax&amp;ie=utf-8">Good XML</a>
</body>
</html>
Notice how all the errors are on line 6 and none are on line 7?

larwilliams
12-18-2009, 10:25 AM
In the links you blog has to external sites like Facebook, and Technorati, you are using & in your links, instead of &amp;

also, you are missing a ; in some sections:

In your template, replace this


<div class="docking" style="border: 0pt none ; margin: 0pt; padding: 0pt; height: 34px;">


with this


<div class="docking" style="border: 0pt none; margin: 0pt; padding: 0pt; height: 34px;">


It is just removing the space between "none" and the ;

sash_007
12-18-2009, 11:05 AM
In the links you blog has to external sites like Facebook, and Technorati, you are using & in your links, instead of &amp;

also, you are missing a ; in some sections:

In your template, replace this


<div class="docking" style="border: 0pt none ; margin: 0pt; padding: 0pt; height: 34px;">


with this


<div class="docking" style="border: 0pt none; margin: 0pt; padding: 0pt; height: 34px;">


It is just removing the space between "none" and the ;

but i have installed sociofluid from their website but where should i edit in header.php .footer.php because i need to edit the php files and upload to the server i cant see any docking class in my php files though i can see it in the output html my point is see my php files not the output errors because its showing html i need to edit the php files i added above

CS-Steve
12-18-2009, 04:39 PM
look for this in your source code
<!-- SocioFluid 1.1 - Social Bookmarking Plugin -->
problem with some of the above plugins it is javascript pulling from their website and you cannot edit the code.

as well this has been already stated look for any & simbols and replace with $amp; specifically where urls are included

larwilliams
12-18-2009, 07:09 PM
OP, truth be told: none of those errors are anything major. No browser cares whether you use & or &amp; in links. It is just good form and one less potential bug to deal with if your customers are using a non-popular browser.