Support

Home Forums Event Espresso Premium Page settings short codes pointing to wordpress url rather than site url

Page settings short codes pointing to wordpress url rather than site url

Posted: June 4, 2013 at 1:01 pm


Cynthia Brown

June 4, 2013 at 1:01 pm

Hello – the short codes used on the 4 transaction pages are all pointing to the wordpress url, rather than the site url and landing on a blank page.

I did find a forum topic that mentioned editing line 276 of includes/functions/email.php (https://eventespresso.com/topic/payment_url-not-working-properly/#post-17388) however, I want to be sure this change won’t be overwritten by new releases.

Any suggestions?

Thank you.


Seth Shoultes

  • Support Staff

June 4, 2013 at 1:06 pm

Hi Cynthia,

I’m not sure that the email.php is your problem. It kind of sounds like it might be an issue with your permalinks or the pages were deleted. Unless you are saying that the payment URL is not working, but it sounds to me like you are having problems with the pages that were generated by Event Espresso.

Can you give us the URL the pages in question?


Cynthia Brown

June 4, 2013 at 1:12 pm

Sure.  Here’s the link I received in my confirmation letter:  http://www.quincycitycrossfit.com/blog/?page_id=485&r_id=2-51ad077a334a8

If you remove the “blog” directory, then the page displays accurately.

http://www.quincycitycrossfit.com/?page_id=485&r_id=2-51ad077a334a8

My WordPress url is:  http://www.quincycitycrossfit.com/blog

My Site url is:  http://www.quincycitycrossfit.com/


Josh

  • Support Staff

June 4, 2013 at 4:53 pm

Hi Cynthia,

If you take a look at the code in email php, you’ll see that it’s set to use the site URL:

$payment_url = get_option('siteurl') . "/?page_id=" . $org_options['return_url'] . "&r_id=" . $data->attendee->registration_id;

Was this a case where WP is installed in /blog and the site URL was changed?

I’ve seen it happen on other WP sites when links start breaking after changing the site URL in the past. Was there a tutorial like the “Giving WordPress It’s Own Directory” step-by-step guide in the WP codex that was followed to make this happen?

http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory


Cynthia Brown

June 4, 2013 at 5:13 pm

Hi Josh, yes, it was installed in /blog and the URL was changed.  And I did follow the guidelines in that tutorial.

However, the Event Registration page works and that was created the same time as the Thank You, Transactions & Registration Cancelled pages.  And the permalinks on those pages don’t show “/blog”


Josh

  • Support Staff

June 4, 2013 at 5:26 pm

What I’m wondering is if something didn’t get updated in the database. The email shortcode uses the siteurl setting. Can you go to

http://www.quincycitycrossfit.com/blog/wp-admin/options.php and scroll down to look for the siteurl setting and check that?

Also, can you check to see if a new email confirmation is doing this (not one generated before the change?)


Cynthia Brown

June 5, 2013 at 4:31 am

Thanks Josh, I just checked the options.php page and noticed that the site URL did have /blog.

I removed /blog – now I can’t log in… ???


Josh

  • Support Staff

June 5, 2013 at 8:21 am

Hi Cindy,

What happens when you try to log in?


Cynthia Brown

June 5, 2013 at 10:38 am

Well, my login uses the /blog directory:  http://www.quincycitycrossfit.com/blog/wp-login.php

When I try to login, WP does a redirect to:  http://www.quincycitycrossfit.com/wp-login.php?redirect_to=http%3A%2F%2Fwww.quincycitycrossfit.com%2Fblog%2Fwp-admin%2Fpost.php&reauth=1

And I land on this login page:  http://extrudeit.com/quincycitycrossfit/wp-login.php
)Which is my main hosting account/domain) and WP says the password I entered is incorrect


Josh

  • Support Staff

June 5, 2013 at 10:48 am

You could try restoring the settings to the way they were before by logging into the cpanel for the host and going to the phpmyadmin screen. This will let you access the wp-options table in the database. The siteURL and blogURL will appear near the top of the list of rows there.


Cynthia Brown

June 5, 2013 at 11:02 am

right-0.  that worked, but the link from my confirmation letter to my payment details is having the same issue – inserting the “/blog” directory into the link; yet the link to the event registration does not….


Cynthia Brown

June 5, 2013 at 11:03 am

incidentally, the link in the invoice to “Pay Online” DOES go to the correct page…


Josh

  • Support Staff

June 5, 2013 at 11:13 am

Right, this is because the siteurl setting has the /blog in it. The code in email.php is using the siteurl option when it builds the payment link:

$payment_url = get_option('siteurl') . "/?page_id=" . $org_options['return_url'] . "&r_id=" . $data->attendee->registration_id;

With the way your site is set up, you might try changing the above line in email.php to make it use homeurl just like Sidney suggested in the other post. I’ll need to check with Sid to see if it’s something that can be changed in the core plugin in future versions.


Cynthia Brown

June 5, 2013 at 11:24 am

ok, I will give that a try, however, I don’t see a functions directory in my wp-includes directory…  am I looking in the right spot for the email.php file?

– I really appreciate your help with this Josh!


Josh

  • Support Staff

June 5, 2013 at 11:32 am

You’ll find the Event Espresso plugin in wp-content/plugins/event-espresso. The email.php file is located in the Event Espresso plugin which is in /includes/functions/email.php.

So the full path to the file is: wp-content/plugins/event-espresso/includes/functions/email.php


Cynthia Brown

June 5, 2013 at 11:47 am

thank you for the location!  however, the change did not work…

I made the update, re-registered for the event to generate a new confirmation and it still added the /blog link

here is a copy of the code I updated in mail.php – which is on line 293

$payment_url = home_url() . “/?page_id=” . $org_options[‘return_url’] . “&r_id=” . $data->attendee->registration_id;


Josh

  • Support Staff

June 5, 2013 at 12:10 pm

It sounds like the home URL is also set to have /blog. Is that the case? Can you check (but please do not change) the home setting in wp-admin/options.php?

You could also try changing it to:

$payment_url = get_home_url() . "/?page_id=" . $org_options['return_url'] . "&r_id=" . $data->attendee->registration_id;


Cynthia Brown

June 5, 2013 at 12:34 pm

nope, home is listed as:  http://www.quincycitycrossfit.com

I also tried updating home_url() to get_home_url( ) – re-registered to get a confirmation and no go…  same issue

 


Josh

  • Support Staff

June 5, 2013 at 12:58 pm

Is there an installation of WordPress for another on the root directory above /blog?


Cynthia Brown

June 5, 2013 at 1:02 pm

yes


Cynthia Brown

June 5, 2013 at 1:11 pm

I think you just discovered my issue!  I was updating the files into the wrong directory!  I am completely embarrassed by this!  You have gone above and beyond to help me with this issue when it was my own incompetence the whole time!  BIG case of user error!  I uploaded the mail.php into the correct directory and the payment link now works!  Head hung low and red-faced… My sincere apologies to swamping you with this issue!  I am truly grateful to you and your support team!


Josh

  • Support Staff

June 5, 2013 at 1:17 pm

This is not going to work then. In order to point the siteurl away from /blog to the root, the root directory needs to be clean. The only files that should be in root are index.php and the .htaccess file (as outlined in this guide:

http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

The support post ‘Page settings short codes pointing to wordpress url rather than site url’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso