Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages » Comments, trackbacks & pings »

Problem with Comment Form Anchor Link


  #1  
Old Jan 7, 2010, 11:31 PM
adum's Avatar
adum
 
85 posts · Jun 2009
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.
  #2  
Old Jan 8, 2010, 02:19 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
what version of Atahualpa and WP?
What is the URL?
Are you using any plugins for comments?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Feb 20, 2010, 04:54 PM
adum's Avatar
adum
 
85 posts · Jun 2009
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

Last edited by adum; Feb 21, 2010 at 11:21 AM.
  #4  
Old Feb 20, 2010, 06:04 PM
adum's Avatar
adum
 
85 posts · Jun 2009
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 &nbsp; 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.

Last edited by adum; Feb 20, 2010 at 10:37 PM.
  #5  
Old Feb 21, 2010, 12:34 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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:
?>
to
HTML Code:
function getH() {
	global $bfa_ata, $post;
	return('#');
	}
?>
next change your post footer from
HTML Code:
<a href="#commentform">Skip to comments form</a>
to
HTML Code:
<?php echo '<a href="'.getH().'commentform">Skip to comments form</a>'; ?>
and you should be ok.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Jun 15, 2010 at 03:46 AM.
  #6  
Old Feb 21, 2010, 04:00 PM
adum's Avatar
adum
 
85 posts · Jun 2009
You da man Juggledad, that fix looks great. I'll try it out in a bit, pretty sure it will work.
  #7  
Old Feb 22, 2010, 08:27 PM
adum's Avatar
adum
 
85 posts · Jun 2009
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);
from postinfo.php? And then insert \ instead of # wherever I use it in the date? Seems kinda weird to even replace \ with # in the first place.

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?

Last edited by adum; Feb 22, 2010 at 09:22 PM.
  #8  
Old Feb 23, 2010, 06:01 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #9  
Old Mar 7, 2010, 09:28 AM
litbea
 
1 posts · Mar 2010
Seems to be working for me...
Thanks a lot!
  #10  
Old Apr 2, 2010, 08:53 AM
gungo
 
31 posts · Jul 2009
San Juan, Puerto Rico
This solution worked perfectly for my site as well... Thanks!
Will make another donation for saving me lots of work!
  #11  
Old Jul 5, 2010, 09:59 AM
c4duser
 
24 posts · Nov 2009
Quote:
next change your post footer from
HTML Code:
<a href="#commentform">Skip to comments form</a>
to
HTML Code:
<?php echo '<a href="'.getH().'commentform">Skip to comments form</a>'; ?>
and you should be ok.
I had the same problem, but in the byline for single page posts. The above code does not work with disqus because the id of the form title is not 'commentform' but rather 'dsq-new-post'. However, changing the code as follows, seems to work:

Code:
<?php echo '<a href="'.getH().'dsq-new-post">Skip to comments</a>'; ?>
I still have a problem with the comment link on the front pages (excerpts) byline which does not go to the form, but to the top of the full article page. This is not so bad with the above correction, but it would be nicer to go directly to the form.

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!

Last edited by c4duser; Jul 5, 2010 at 10:33 AM. Reason: small correction.
  #12  
Old Dec 9, 2010, 07:11 PM
scrollpost
 
17 posts · Jan 2010
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>
use this syntax

Code:
<?php echo '<a href="'.getH().'name">Go to name</a>'; ?>

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] BUGFIX - 3.4.1-&gt;3.4.6 - Comment form will not show up after first comment on juggledad Comments, trackbacks & pings 49 Jul 29, 2010 06:01 PM
How to change anchor text used for %author-link% ? JFG Post-Kicker, -Byline & -Footer 0 Dec 29, 2009 08:29 AM
[SOLVED] problem with hover effect in anchor link destination hiccupgirl Atahualpa 3 Wordpress theme 1 Oct 16, 2009 06:25 PM
Comment form: how do I clear the data from name and email when the form is submitted? blueprairie Comments, trackbacks & pings 3 Sep 15, 2009 05:15 PM
Clicking "Leave a comment" does not lead to comment form Fux Comments, trackbacks & pings 2 May 4, 2009 11:34 PM


All times are GMT -6. The time now is 05:42 AM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.