Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 09-19-2008, 08:24 AM   #1
Active Warrior
War Room Member
 
Join Date: Jun 2008
Posts: 96
Blog Entries: 1
Thanks: 12
Thanked 2 Times in 2 Posts
Default Wordpress wp-comments-post.php redirect issue - please help

Hi. I'm wondering how I can add a space to the URL that wordpress redirects me to after I post a comment to an entry.

Line 80/81 of the newest version of wp-comments-post.php look like this:

$location = ( empty($_POST['redirect_to']) ? get_permalink($comment_post_ID) : $_POST['redirect_to'] ) . '#comments';
$location = apply_filters('comment_post_redirect', $location, $comment);

Right now it is redirecting me to:
http://www.websitename.com/2008/09/entrytitle#comments

I need a space before "#comments" appears in the URL, like this:
http://www.websitename.com/2008/09/entrytitle #comments

I've tried modifying line 80 in quite a few ways, I just can't get this to work the way I need. I'm really not a PHP programmer, but I get around alright when it comes to modifying existing code.

Any help????
Tony_D is offline   Reply With Quote
Old 09-19-2008, 09:39 AM   #2
Head Distrustee
 
Pete Janelle's Avatar
 
Join Date: Aug 2008
Location: Florida, USA
Posts: 32
Thanks: 0
Thanked 1 Time in 1 Post
Default Re: Wordpress wp-comments-post.php redirect issue - please help

Try adding "%20" as the space. If you go to a URL with a space, that's what the browser replaces it with.

http://www.websitename.com/2008/09/entrytitle%20#comments

Not sure if this will work in PHP code, but it's worth a shot.

Here's a good reference for special characters:

http://www.blooberry.com/indexdot/html/topics/urlencoding.htm

My GPS Camera Phone: adventures in mobile phone photography
Brain (dis)Trust: a meeting of my minds

Last edited by Pete Janelle; 09-19-2008 at 09:40 AM. Reason: Added link to special character reference page
Pete Janelle is offline   Reply With Quote
Old 09-20-2008, 03:21 PM   #3
Active Warrior
War Room Member
 
Join Date: Jun 2008
Posts: 96
Blog Entries: 1
Thanks: 12
Thanked 2 Times in 2 Posts
Default Re: Wordpress wp-comments-post.php redirect issue - please help

awesome, Pete. That fixed the problem perfectly. Thanks.
Tony_D is offline   Reply With Quote
Old 09-21-2008, 09:47 AM   #4
Head Distrustee
 
Pete Janelle's Avatar
 
Join Date: Aug 2008
Location: Florida, USA
Posts: 32
Thanks: 0
Thanked 1 Time in 1 Post
Default Re: Wordpress wp-comments-post.php redirect issue - please help

Glad to help.

My GPS Camera Phone: adventures in mobile phone photography
Brain (dis)Trust: a meeting of my minds
Pete Janelle is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Tags
code, issue, php, redirect, url, wordpress, wpcommentspostphp

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 01:47 PM.