Problem with Comment Form Anchor Link
I am trying to insert this link into my post footer to jump to the comments form, but the link gets changed once I load it on my site...
<a href="#commentform">Skip to comments form</a> essentially gets changed to: <a href="\commentform">Skip to comments form</a> In the link on the page, the # gets changed to a \. What can I do to fix this? Thanks. |
what version of Atahualpa and WP?
What is the URL? Are you using any plugins for comments? |
I never figured out a solution to this problem and ended up just using a workaround, but now I can't get around the issue.
I realized the problem is that in the "Post/Page Info Items", "#" is used to escape certain letters, and thus gets converted to "\" in the URL. I can use anchor links with # in the center column, and they are fine, it's just fact that I am trying to use them within the Post/Page Info Options of ATO. (I turned all plug-ins off btw, so this has got to be Atahualpa.) Any way to get around this? I am extremely suprised that this was never caught before. I am using 3.4.5 and WP 2.9.2. My site is http://www.adamcapriola.com EDIT: I switched my Disqus plugin back on which alleviates the error to an extent. You can see in the "Leave a Comment" link it looks like this: "http://www.adamcapriola.com/\dsq-new-post" when it should be "http://www.adamcapriola.com/#dsq-new-post" Thanks in advance JD/Flynn! -Adam |
Alright well I tried looking into the problem a little more, seems like a pretty deep issue.
I tried using the HTML character entity for "#" which is "&#threefive;" (couldn't type 35 here because it got converted) in the URL, but all #'s are converted to \ so it doesn't work. # doesn't have a HTML name entity either like which would work. Something in the functions has be changed I think. EDIT: Guessing the change has to be made in bfa_ata_admin.php or functions.php. I am just not familiar enough with how to fix this thing myself. |
Ok, this is messy but fixable.
The problem here is that the '#' is used as the php DATE escape character in the Atahualpa options. Because the php DATE() function has so many options and each needs to be escaped, so when the footer (or kicker or title) is being displayed, all occurrences of '#' are changed to '\' leading to this problem. But take heart, there is a way to make it work. change the last line of bfa_postinfo.php from HTML Code:
?> HTML Code:
function getH() { HTML Code:
<a href="#commentform">Skip to comments form</a> HTML Code:
<?php echo '<a href="'.getH().'commentform">Skip to comments form</a>'; ?> |
You da man Juggledad, that fix looks great. I'll try it out in a bit, pretty sure it will work. :)
|
errr didn't work. This is now my URL:
http://www.sixprizes.com/'.getH().'dsq-new-post Would it be easier to turn off the # converting to \ for the date and just use a different convention for the date? P.S. Tried this fix on my site that is using 3.4.4...that shouldn't make a difference though, should it?' EDIT: What if I just delete this line: Code:
$postinfo_string = str_replace("#", "\\", $postinfo_string); EDIT 2: Ok well I deleted that line and my URLs are cool and my date still works...is there any backlash to making this change? Would it be better to just choose a different arbitrary character instead of # to replace? |
did you wrap the code I gave in the php echo? and make sure the single quotes and double quotes were in the correct places. This code worked for me.
If you fix works without any problems, use it. |
Seems to be working for me...
Thanks a lot! |
This solution worked perfectly for my site as well... Thanks!
Will make another donation for saving me lots of work! |
Quote:
Code:
<?php echo '<a href="'.getH().'dsq-new-post">Skip to comments</a>'; ?> If you want to link to jump to the Disqus logo with the 'like' buttons, use 'dsq-community' instead of 'dsq-new-post'. Thanks for the code, Juggledad! |
I just used this fix. Thanks...
One suggestion: there is a partial explanation on the page but it's not clear. I would add to the page something like this - To use named anchors from a Post/Page Info Items section please add the following: For a named anchor like this Code:
<a href="#name">Go to name</a> Code:
<?php echo '<a href="'.getH().'name">Go to name</a>'; ?> |
All times are GMT -6. The time now is 06:50 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.