SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Validation Error - Element "a"

    Hi everyone!

    I am new to the forum and hope to find some help. I am not a developer, neither understand much about XHTML. I am trying to validate my wordpress website and I was able to correct some errors, but there's one I don't understand and I am unable to fix:

    document type does not allow element "a" here; missing one of "object", "span", "bdo", "applet", "iframe", "tt", "i", "b", "u", "s", "strike", "big", "small", "font", "em", "strong", "dfn", "code", "q", "samp", "kbd", "var", "cite", "abbr", "acronym", "sub", "sup", "label", "ins", "del" start-tag.
    I think this happens in this line:

    Code:
    <span class="number-of-comments"><a href="<?php the_permalink() ?>#comments" title="title"><?php comments_popup_link('Coment&aacute;rios', '1 Coment&aacute;rio!', '% Coment&aacute;rios!'); ?></a></span>
    Any help would be great! Thanks!

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,411
    Mentioned
    149 Post(s)
    Tagged
    4 Thread(s)
    Validation is done on the (X)HTML that is a result of your PHP code, so you'd better post what is received by your browser, not the script full of PHP function calls.

  3. #3
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, but like I said before I am not a developer, so I am not sure what to post!
    I hope this is what you asking me to post!

    Code:
    <?php get_header(); ?>
    	<div id="content">
    		<div id="main-content">
    		<?php if (have_posts()) : ?>
    			<?php while (have_posts()) : the_post(); ?>
    				<div class="post" id="post-<?php the_ID(); ?>">
    					<h6><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h6>
    					<span class="date"><?php the_time('j.m.Y') ?></span>
    					<div class="entry">
    						<?php the_content(__('Continuar a ler').' &raquo;'); ?>
    					</div>
    						<p class="postmetadata">Categoria: <?php the_category(' | ') ?> </p>
    						<p class="postmetadata">Tags: <?php the_tags(' ',' | ') ?> </p>
    						<span class="number-of-comments"><a href="<?php the_permalink() ?>#comments" title="title"><?php comments_popup_link('Coment&aacute;rios', '1 Coment&aacute;rio!', '% Coment&aacute;rios!'); ?></a></span>
    				</div> <!-- close:post -->
    			<?php endwhile; ?>
    			<div class="pagination clearfix">
    				<div class="prev"><?php next_posts_link('&laquo;&laquo;') ?></div>
    				<div class="next"><?php previous_posts_link('&raquo;&raquo;') ?></div>
    			</div>
    		<?php else : ?>
    			<p class="string"><?php _e('Lamento, mas a p&aacute;gina que procura n&atilde;o existe.'); ?></p>
    		<?php endif; ?>
    		</div> <!-- close:main-content -->
    	<!-- close:content -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, that's still the PHP code.

    Open the page in your browser, right-click and select 'View Source' (or similar, depending on your browser). Then copy and paste the relevant part of the HTML markup.
    Birnam wood is come to Dunsinane

  5. #5
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh! Hope I got it right this time:

    Code:
    <span class="number-of-comments"><a href="mysite.com/?p=1155#comments" title="title"><a href="mysite.com/?p=1155#respond" title="Comment on My Post">Comments</a></a></span>
    Thanks!

  6. #6
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah! I see the problem. You've got one link inside another (<a><a></a></a>). That's not allowed. Links can't contain other links.
    Birnam wood is come to Dunsinane

  7. #7
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your help! I will try to fix that! Cheers!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •