CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Wordpress donate pages revert to home page
Pages: [1]

Author Topic: Wordpress donate pages revert to home page  (Read 885 times)

RachelWright

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 3
  • CiviCRM version: 4.2.7
  • CMS version: Joomla 2.5.17
  • MySQL version: 5.5.37
  • PHP version: 5.4.26
Wordpress donate pages revert to home page
August 02, 2012, 02:05:00 pm
The wordpress shortcode worked great to place a contribution form on my donate page,  www.mysite.org/donate/ but once you click the "confirm contribution" button it places all the next screen's content on the home page. I have tried this with three different themes with the same results (except that sometimes the civi content shows up in different places on the home screen, or on one theme, not at all).

How do I tell Civi to used a post or page template and not the home page?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Wordpress donate pages revert to home page
August 02, 2012, 08:15:35 pm

you might want to switch to using default permalinks for now.

Civi v4.1 (and maybe even 4.2) does not work nicely with the non-default settings for WP permalinks

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

RachelWright

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 3
  • CiviCRM version: 4.2.7
  • CMS version: Joomla 2.5.17
  • MySQL version: 5.5.37
  • PHP version: 5.4.26
Re: Wordpress donate pages revert to home page
August 03, 2012, 08:47:01 am
That does work, but I would like to keep my pretty links, as we have marketing material etc set up for mysite.org/donate etc.  I did find a sort of fix, based on this post (http://forum.civicrm.org/index.php?topic=22805.0)

In the in CRM/Utils/System/Wordpress.php I changed this:
Code: [Select]
if ( is_admin() && !$frontend ) {
            $base .= 'wp-admin/admin.php';
        }

to
Code: [Select]
        if ( is_admin() && !$frontend ) {
            $base .= 'wp-admin/admin.php';
        } else {
            $base .= 'donate';
        }

It seems to be working, but I'd have to manually change this each time I updated. And I am not really sure if this would affect anything else. Am I missing an easier way to specify a template for civi pages?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Wordpress donate pages revert to home page
August 03, 2012, 11:57:55 am

Can you take a look and figure out how to generalize the below patch. Some things we'll need to test with WP 3.4 include:

a. ensure it works with all permutations of permalinks

b. ensure it works for both frontend and backend

c. ensure the absolute url generation is still working. This can be tested via civimail

d. ensure it works for both event / contribute pages

We've had a few bugs with some submitted patches with regard to the above and really need to make sure we dont mess up for future patches. Would be good to get unit tests associated with all the above for WP

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

RachelWright

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 3
  • CiviCRM version: 4.2.7
  • CMS version: Joomla 2.5.17
  • MySQL version: 5.5.37
  • PHP version: 5.4.26
Re: Wordpress donate pages revert to home page
August 07, 2012, 02:04:31 pm
My original solution (hack) did not hold up to your tests, but I think I have come up with an alternate fix.  I am still testing your four requirements on the new idea and will report when I have something solid! Thanks!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Wordpress donate pages revert to home page

This forum was archived on 2017-11-26.