2

On a Wordpress site which uses the theme "Enlightenment" I have used civicrm shortcode to embed a civi Contribution form on a wp page. All is well until I click the Confirm Contribution button.. the next page that is returned (Contribution confirmation page) has the form results replicated in the wp/enlightenment footer

a part of the footer as it appears before contribution submission: https://i.sstatic.net/A2WYW.jpg

same part of the wp footer as it appears after submission.. https://i.sstatic.net/ByiCL.jpg

I've studied the page source for these two cases and it appears that civi's

It seems that the problem is related to the civContribution webform submission - any ideas on why the proper style inheritance would be lost after form submission and how/where I can fix this problem?

I realize this is a case of Enlightenment probably doing something the civiContribute doesn't expect but since all is well before form submission I suspect that there could be a civi way to fix this.

3
  • I'm under the gun to get this working, and would be happy if I could just get the Contribution form working with connectivity to the CiviCRM db without the wordpress theme.. i.e. i'd be happy with plain html at this point. Is there any way to route entirely around the wordpress theme just for the Contribution webform?
    – ddesign
    Commented Sep 13, 2015 at 16:56
  • 1
    What version of Civi are you using? There were significant improvements to WP integration in 4.6, if you aren't on that already... Commented Sep 14, 2015 at 14:57
  • 1
    CiviCRM 4.6.8 and WP 4.2.4
    – ddesign
    Commented Sep 14, 2015 at 16:11

2 Answers 2

2

I installed the plugin Multiple Themes (https://wordpress.org/plugins/jonradio-multiple-themes/) which allows me to set a different wp theme (e.g. Twenty Fifteen) just for the /?page=CiviCRM pages. Now I no longer have the replicated webform problem. The Contribution page appears has a different look & feel but I'm ok with this. Thanks so much for the help Andrew.

1

Could you set a Civi basepage and apply an extremely cut down template to that specific page?

You'd need to create a custom page template in your theme directory. Create the file, then fill it with the most basic content possible. So something like:

<?php /* Template Name: Basic Template */ ?>
<html>
  <head>
    <?php wp_head(); ?>
  </head>
  <body>
    <?php 
    if ( have_posts() ) {
        while ( have_posts() ) {
            the_post(); 
                the_content(); 
        } // end while
    } // end if
    ?>
  <?php wp_footer(); ?>
  </body>
<html>

Then on the base page, change its template to 'Basic Template' and update.

This would apply to all pages that Civi uses, so is inherently pretty hacky.

7
  • I just went to my civi basepage and I don't see a way to eliminate the Wordpress markup other than what I did on the Page I created that I refer to above in which I inserted Civi shortcode pointer to Contribute page I configured. not sure how the base page would help..
    – ddesign
    Commented Sep 14, 2015 at 16:52
  • updated my comment to show how to add a custom template. Commented Sep 14, 2015 at 17:28
  • ok, I did what you indicated.. the Enlightenment theme doesn't have a page.php but it does have an index.php so I created a file called index-plain.php and pasted in your code. I added in "echo 'Test';" where you have // Post Content here. I edited the /CiviCRM base page, unchecked the enlightenment sidebar/feature hook boxes and selected 'Basic Template' from the Template dropdown, and indeed when I View page I just see "Test" printed at the top left. Forgive me for being such a newb but how do I now insert my Contribution form into this scenario? thank you..
    – ddesign
    Commented Sep 14, 2015 at 20:56
  • If that's the base page being used by Civi pages, then when you go to your contribution form it should now display using this template. If not you can force it: use the code from 'The wpBasePage' at civicrm.org/blogs/haystack/working-civicrm-46-wordpress into your functions.php file - but change 'my-template-name.php' to 'index-plain.php'. Commented Sep 14, 2015 at 22:00
  • 1
    oops, sorry - missed a function. Replace your "echo 'Test';" with "the_content();". I've updated my answer. Commented Sep 15, 2015 at 18:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.