• Howdy Folks,

    I’m seeing an issue with the Comments from my WordPress blog, specifically … the direct link to a comment is in the format of (for example):

    http://www.mysite.com/post-permalink/#comment-1908

    But following this link just leads to:

    http://www.mysite.com/post-permalink/

    … and not to the comment itself (that is, the correct URL is in the browser address field, containing the full link to the comment, but only the main page is displayed, it doesn’t ‘skip down’ to the appropriate comment).

    The source of the rendered page shows the comment rendered as:

    <div id="commentbox">
    <div class="commentid">
    <a href="#comment-1908">1908</a> </div>
    <p class="commentby">Comment by JOHN
    
    <p class="commentinfo">March 20, 2007 @ 10:37 pm 
    
    COMMENT TEXT
    
    </div>

    Shouldn’t the <a HREF="#comment-1908"> tag actually be <a NAME="#comment-1908">?

    Is that why this is not working, and if so, how could I go about resolving this?

    Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • No href is right because it is actually a link. Sounds like you have something screwy going on with your permalinks try doing an update permalink and see if that helps.

    Thread Starter mookus

    (@mookus)

    Hmm, no love on the ‘Update Permalink Structure’ front.

    Maybe something odd in the .htaccess?

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    </IfModule>

    It’s driving me nuts. 🙂

    No that’s the standard .htaccess, shouldn’t be any problems with that. Check your server logs and see if you see anything out of the ordinary when you try to navigate to the comments.

    Thread Starter mookus

    (@mookus)

    Mmm, unfortunately I only have ‘Webalyzer’ stats access from my server host, not the actual raw logs … I don’t think I have any way to check the server logs down to such a fine detail. 🙁

    I had the exact same problem, do you use the Kubrick theme as well?

    What I did was the following… I changed:
    <div class="comentarios">
    to ->
    <div class="comentarios"id="comment-<?php comment_ID() ?>">

    Anquor links look for IDs as well (not only for <a name="xy">. But be aware that your comments.php may look very different from mine, depending on your theme.

    Thread Starter mookus

    (@mookus)

    A couple of things I’ve noted after more fiddling:

    1) The link to …

    http://www.mysite.com/post-permalink/#comments&#8221;

    … works just fine, but links to …

    http://www.mysite.com/post-permalink/#comment-1234&#8221;

    … still do not.

    2) When viewing the blog with the default theme, everything works as intended.

    I’m now concentrating my efforts on the CSS file of the theme I’m using (though I’m not really sure what I’m looking for, at least I think I’m looking in the right place!)

    There is nothing in the CSS files when it comes about links. Links are HTML, so they should be in the templatye files.

    Thread Starter mookus

    (@mookus)

    Thanks for all the replies folks, still working on it.

    Moshu I’m not sure I’m understanding what you mean by “there is nothing in the CSS files when it comes about links.” The CSS files for both my current theme, Blue Horizon (which my current theme was modded from), and the WordPress Default theme have many, many entries for comments and/or links.

    As mentioned, my current theme is a three-column variation of Blue Horizon – I set my theme back to the original Blue Horizon and am having the same problem.

    So now I’m trying to discover what is different between the CSS files of the WordPress Default (based on Kubrick according to its notes), which works, and those of Blue Horizon/Blue Horizon Variant, which do not.

    You were complianing about LINKS (anchor tags) in the template files. Where the links point and what they do – it is always only in the template file(s).

    How do they look like… it should be in the CSS file. But through CSS you will never succeed to change where a link goes. Even if there are tons of entries for it.

    Thread Starter mookus

    (@mookus)

    OH – I see what you were saying now Moshu, thanks for clarifying.

    I honestly was not following, hope you didn’t take it personally. 🙂

    Anyway, like I said thanks for pointing that out – I swapped out the ‘comments.php’ file from my current theme with the one from WordPress default and the comment links work!

    It breaks the formatting though, so now I need to compare the two ‘comments.php’ files and see how to get the formatting of my current one to work with the links from the default one … but at least now I know for sure I’m looking in the right spot.

    Yay!

    Thread Starter mookus

    (@mookus)

    Okay – I finally have comments in a format I find aesthetically pleasing, and behaving as expected link-wise.

    I had to make changes to my theme’s “comments.php” file -and- to the CSS file, since they weren’t using the same header tags.

    Thanks for all the help folks, I definitely would not have figured out how to fix this without ya. 🙂

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Comments Direct Links – Using ‘href’ instead of ‘name’’ is closed to new replies.