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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Re: Problem with WordPress Custom Template - Started again...
Pages: [1]

Author Topic: Re: Problem with WordPress Custom Template - Started again...  (Read 3230 times)

AnnaD

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
  • CiviCRM version: 4.2.8 WordPress
  • CMS version: Wordpress 3.5.1
  • MySQL version: 5.0
  • PHP version: 5.3
Re: Problem with WordPress Custom Template - Started again...
May 01, 2013, 01:15:10 pm
Hi, this thread looks like what I need to ask about - I want to use a different page in my wordpress installation for CiviCRM forms, rather than the home page - and this thread was bang on topic:
http://forum.civicrm.org/index.php/topic,28110.0.html

However, I've started a new topic because it is longer than 30 days since the last post there.

I've added the code:  define( 'CIVICRM_UF_WP_BASEPAGE', 'Events');        to the civicrm.settings.php file.

I've also made a page in our Wordpress installation called 'Events'. The idea, I understand, is that CiviCrm should now put its forms on this new page.

However, the forms are still appearing on our site's home page, as before, and very nice they are too.

Any ideas as to what else I should be doing to get this right?

Thanks for your help,
A

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: Problem with WordPress Custom Template - Started again...
May 01, 2013, 04:56:35 pm

I would double check and ensure that it is added in the right file:

wp-content/plugins/civicrm/civicrm.settings.php

thats all you need to do, if it does not work, i suspect u'll need to debug the code and figure out whats happening and why. The relevant code is at:

CRM/Utils/System/WordPress.php, function url

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

KilakwaBT

  • I post occasionally
  • **
  • Posts: 101
  • Karma: 11
  • CiviCRM version: 4.5.5
  • CMS version: WordPress 4.1
  • MySQL version: 5.1.68
  • PHP version: 5.3
Re: Problem with WordPress Custom Template - Started again...
May 02, 2013, 08:13:37 pm
Check your permalinks. I have had chance to work on this over the last few days after my initial work on it about a month age. Here are some things look for.

1. make sure you edited the correct file that is referenced by Lobo in the previous post.
2. name your page as referenced in the define( 'CIVICRM_UF_WP_BASEPAGE', 'Events'); I usually have a custom template for this page in WordPress.
3. make sure your permalink references the page by name. For Example if your page is "Events" the permalink for the page should be <URL to WordPress Dir>/Events/

In my previous post the install was older and the permalinks were a mess which was causing the problems.

Hope this helps

BT

AnnaD

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
  • CiviCRM version: 4.2.8 WordPress
  • CMS version: Wordpress 3.5.1
  • MySQL version: 5.0
  • PHP version: 5.3
Re: Problem with WordPress Custom Template - Started again...
May 03, 2013, 08:44:32 am
Hi All,
thanks for your help.
No luck so far. I've checked the wp-content/plugins/civicrm/civicrm.settings.php file, and placed the following straight under the BaseURL command, as follows:
define( 'CIVICRM_UF_BASEURL'      , 'http://www.druweb.info/' );
define( 'CIVICRM_UF_WP_BASEPAGE', 'Events' );

The permalink for the page is: http://www.druweb.info/events/
This page works if I type that into the browser.
I've tested for case-sensitiveity by changing the permalink as well as the code from events to Events, with no luck.

Hmmm! I notice that our developer has installed both an SEO plugin and a Bullet Proof Security plugin, so maybe they are interfering somehow. I'll look into disabling them and trying again.

Unless there's anyting else you can think of?

Thanks for your help,

A

AnnaD

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
  • CiviCRM version: 4.2.8 WordPress
  • CMS version: Wordpress 3.5.1
  • MySQL version: 5.0
  • PHP version: 5.3
Re: Problem with WordPress Custom Template - Started again...
May 03, 2013, 08:49:13 am
Just had one other thought. Is there a cache somewhere that maybe I should clear?

Thanks,

A

aglozier

  • I post frequently
  • ***
  • Posts: 135
  • Karma: 9
    • Phoenix Academy
  • CiviCRM version: 4.7.9
  • CMS version: WordPress 4.6.1
  • MySQL version: 5.7.14
  • PHP version: 5.6.21
Re: Problem with WordPress Custom Template - Started again...
May 03, 2013, 06:26:58 pm
It works for me for Personal Campaign Pages (PCP) with version 4.3.2. 

I added a blank WordPress page called "blank".   I modified the settings file to include:
Code: [Select]
define( 'CIVICRM_UF_WP_BASEPAGE', 'blank');
When I goto my PCP from within CiviCRM, it goes to the URL "website/blank/?page=CiviCRM&q=civicrm/pcp/info&reset=1&id=1" and show my PCP page formated correctly.

What I did appears to be what you are trying.  The only difference I can see is that I'm using version 4.3.2.  Also I didn't add the define statement.  It was already in the settings file commented out.  I edited that.

In the settings file it said:
Quote
This will be moved to a DB setting in 4.3, check CRM-10682
Did this get included in 4.3?  I don't see it.

aglozier

  • I post frequently
  • ***
  • Posts: 135
  • Karma: 9
    • Phoenix Academy
  • CiviCRM version: 4.7.9
  • CMS version: WordPress 4.6.1
  • MySQL version: 5.7.14
  • PHP version: 5.6.21
Re: Problem with WordPress Custom Template - Started again...
May 04, 2013, 05:24:00 am
There is a possibility that the name of the page, "events", that you are using for CIVICRM_UF_WP_BASEPAGE is causing the problem.  I first tried using "civicrm" for CIVICRM_UF_WP_BASEPAGE and it didn't work.  Then I change the name to "blank" and it worked.  Maybe "civicrm" and possibly "events" are variable names or something within the CiviCRM program.  Try using "blank" or something not related to CiviCRM.

KilakwaBT

  • I post occasionally
  • **
  • Posts: 101
  • Karma: 11
  • CiviCRM version: 4.5.5
  • CMS version: WordPress 4.1
  • MySQL version: 5.1.68
  • PHP version: 5.3
Re: Problem with WordPress Custom Template - Started again...
May 04, 2013, 05:38:06 am
I'm using events without a problem. Also, while the define statement is commented out by default in the civicrm.settings file. it can be anywhere in the file. It is easiest and probably a best practice to just un-comment the existing line.

It may be version related. I did have trouble with this on an install with Version 4.2.8. I thought it was related to problems with the WordPress side since it was a bit of a mess.

BT

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: Problem with WordPress Custom Template - Started again...
May 04, 2013, 04:41:21 pm

Quote
This will be moved to a DB setting in 4.3, check CRM-10682
Did this get included in 4.3?  I don't see it.

No it did not make it. we did not receive a patch for this :(

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

AnnaD

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
  • CiviCRM version: 4.2.8 WordPress
  • CMS version: Wordpress 3.5.1
  • MySQL version: 5.0
  • PHP version: 5.3
Re: Problem with WordPress Custom Template - Started again...
May 05, 2013, 04:32:24 pm
Hi everyone,
thanks so much for your help. CiviCRM is a great community!

I've tried everything that's been shared above, but with no success so far. However, i haven't had the chance to fully test the scenario with and without the SEO and Bulletproof security plugins yet, so the jury's still out....

Best wishes,
A

aglozier

  • I post frequently
  • ***
  • Posts: 135
  • Karma: 9
    • Phoenix Academy
  • CiviCRM version: 4.7.9
  • CMS version: WordPress 4.6.1
  • MySQL version: 5.7.14
  • PHP version: 5.6.21
Re: Problem with WordPress Custom Template - Started again...
May 06, 2013, 05:43:31 am
I use Yoast SEO on our site and it works for me.
« Last Edit: May 06, 2013, 05:48:54 am by aglozier »

oreo_masta

  • I’m new here
  • *
  • Posts: 4
  • Karma: 2
  • CiviCRM version: 4.3.2
  • CMS version: Wordpress 3.5.1
  • MySQL version: 5.5.30
  • PHP version: 5.3.24
Re: Problem with WordPress Custom Template - Started again...
October 06, 2013, 03:27:02 pm
Sorry to reply to an old topic, but I don't need to bring anything new up. I'm just adding my experience to the thread as I pieced together a similar puzzle.

The Wordpress site I am working on exists in a subdirectory on the webserver /example/public_html/wordpress but I've configured the Wordpress index.php file so that it comes up at http://www.example.com rather than http://www.example.com/wordpress

I've installed CiviCRM as a plug-in and for images and other functionality in CiviCRM to work correctly I have the following set in civicrm.settings.php

define( 'CIVICRM_UF_BASEURL', 'http://www.example.com/wordpress/' );

As others have outlined in this thread and in CRM-10682 I needed to set CIVICRM_UF_WP_BASEPAGE so that public subscribe/unsubscribe works. My process was as follows:

  • In Administer > Users and Permissions > Permissions (Access Control) > WordPress Access Control, I made sure to give Anonymous access to CiviMail: access CiviMail subscribe/unsubscribe pages.
  • I created a Page in Wordpress simply titled civi-public which resolves at the URL http://www.example.com/civi-public
  • In civicrm.settings.php I modified the following line to be define( 'CIVICRM_UF_WP_BASEPAGE', 'civi-public');
At this point, I could see the setting had taken affect. I sent myself a test email and the opt-out link changed to http://www.example.com/wordpress/civi-public?page=CiviCRM&q=civicrm/mailing/optout&reset=1&jid=123&qid=12345&h=123a45678bc9de01

However, this triggered a 404 error. After trying several things I discovered that the URL  http://www.example.com/civi-public?page=CiviCRM&q=civicrm/mailing/optout&reset=1&jid=123&qid=12345&h=123a45678bc9de01 resolved the opt-out page correctly. However, changing CIVICRM_UF_BASEURL to http://www.example.com/ broke other areas of CiviCRM.

I'm not claiming that it's the proper one, but a solution that worked for me was to add and appropriate redirect to my .htaccess file for the site.

RedirectMatch 301 /wordpress/civi-public(.*) /civi-public/$1

Public opt-out is now working properly for me. Cheers!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Re: Problem with WordPress Custom Template - Started again...

This forum was archived on 2017-11-26.