Answers.Body: <p>This relates to the custom WordPress theme you're using, whose default/CiviCRM template doesn't work as expected by CiviCRM.</p>
  
  <p>As Christian Wach says in his answer to <a href="https://civicrm.stackexchange.com/q/2112/149">Why does CiviCRM render a validation failure without the Wordpress theme?</a>, this can be resolved by adding some custom code to a plugin on your site, or by modifying your custom theme to closer match the output of WordPress default themes (which are currently the reference themes that CiviCRM is tested with).</p>
  
  <p>This issue can be duplicated with the <a href="https://wordpress.org/themes/virtue/" rel="nofollow noreferrer">free version of the Virtue theme</a> you state you're using - here's the confirm page using the <a href="https://www.dropbox.com/s/0unzhqrsea8p4bn/Screen%20Shot%202016-01-04%20at%209.41.53%20am.png?dl=0" rel="nofollow noreferrer">TwentySixteen theme</a> and <a href="https://www.dropbox.com/s/px7tgs3e16x07kc/Screen%20Shot%202016-01-04%20at%209.42.06%20am.png?dl=0" rel="nofollow noreferrer">Virtue</a> side by side.</p>
  
  <p>If you want to pursue using that theme, you'll need to look into addressing this - talking to the theme authors &amp; requesting CiviCRM support would be my recommendation.</p>
  
  <p>EDIT: Adding code from a comment below by @Darren; this would be added to your theme's <code>functions.php</code></p>
  
  <pre><code>add_filter('civicrm_basepage_template', 'use_my_own_template_for_civi');
  
  function use_my_own_template_for_civi($template) { 
    if ($template=='page.php') { 
      return 'templates/front-page.php';
    } 
    return $template; 
  }
  </code></pre>
  
  <p>I'm not sure the <code>templates/</code> prefix should be in there - perhaps a Wordpress user can confirm what works :)</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-29T21:15:10.210Z
Answers.Text: I am comparing 2 themes. Neither one has a the_content function. One them displays all the contribution form pages correctly (Iconic One) and the other one doesn't (Virtue Premium).
Answers.UserDisplayName: P a u l
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-29T21:35:58.627Z
Answers.Text: That's good, you've isolated the issue to your custom theme at least. Next step is to work out what differs between core/working themes and the custom one that doesn't
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-29T21:39:41.633Z
Answers.Text: Answer updated (the `the_content()` references may not be helpful if the themes no longer contain that, but the basic answer stands).
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-03T20:50:47.490Z
Answers.Text: @Paul IMO this is the correct answer for your situation, based on the discussion & comments in this thread. Please consider accepting it?
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-03T21:57:24.053Z
Answers.Text: Probably what's going on. No possibility to fix however. That wordpress/php spaghetti code just gives me a headache.
Answers.UserDisplayName: P a u l
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-03T22:01:16.833Z
Answers.Text: Unfortunately not an uncommon experience with all singing, all dancing theme solutions. If you stay within narrow bounds they can work fine, but when something goes out of that bounds ... At least you have the source though!
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-01T09:35:18.173Z
Answers.Text: Just so the answer is here, the WordPress theme's not using 'page.php' (as @christian-wach [explained](http://civicrm.stackexchange.com/questions/2112/why-does-civicrm-render-a-validation-failure-without-the-wordpress-theme). Our theme uses 'templates/front-page.php' So we simply need to add the code snippet below to the bottom of our theme's "functions.php" file: `add_filter( 'civicrm_basepage_template', 'use_my_own_template_for_civi' ); function use_my_own_template_for_civi( $template ) { if ( $template=='page.php' ) { return 'templates/front-page.php'; } return $template; }`
Answers.UserDisplayName: Darren
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-29T04:23:06.380Z
Answers.LastActivityDate: 2016-04-08T02:42:22.873Z
Answers.LastEditDate: 2017-04-13T12:53:13.207Z
Answers.UserDisplayName: Chris Burgess
Answers.Body: <p>Do you see <code>&amp;snippet=1</code> in your contribute page URL?</p>
  
  <p>That parameter can be used to deactivate the theme on a CiviCRM page.</p>
  
  <p>Eg -</p>
  
  <ul>
  <li>CiviCRM demo <a href="http://d46.demo.civicrm.org/civicrm/contribute/transact?reset=1&amp;id=1&amp;action=preview" rel="nofollow">donate page as per normal</a> &amp; then <a href="http://d46.demo.civicrm.org/civicrm/contribute/transact?reset=1&amp;id=1&amp;action=preview&amp;snippet=1" rel="nofollow">without theme</a></li>
  <li>CiviCRM <a href="http://d46.demo.civicrm.org/civicrm/profile/create?gid=1&amp;reset=1" rel="nofollow">profile page as normal</a> &amp; same <a href="http://d46.demo.civicrm.org/civicrm/profile/create?gid=1&amp;reset=1&amp;snippet=1" rel="nofollow">without theme</a></li>
  </ul>
  
  <p>If that parameter is present in the link to your contribution page, remove it and see if this restores the proper theme.</p>
  
  <p>Does your contribute page still work without the theme?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-22T15:58:54.437Z
Answers.Text: I don't see the snippet thing.
Answers.UserDisplayName: P a u l
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-22T10:39:22.263Z
Answers.LastActivityDate: 2015-12-22T10:39:22.263Z
Answers.UserDisplayName: Chris Burgess
Answers.Body: <p>This might happen if you had a contribute page served over SSL, which referenced theme resources (CSS, images) which were served from a non-SSL URL.</p>
  
  <p>Is your site served over both SSL (https) and non-SSL (http)? If so you need to account for this when dealing with URLs throughout CiviCRM.</p>
  
  <p>(It's far easier, and more secure for all, to just use SSL all the time.)</p>
  
  <hr>
  
  <p>To debug this, I would load the initial page with the browser's Dev Tools open, watching the Network tab to see which resources were included. Then when you proceed to the next page, compare the activity on the Network tab there.</p>
  
  <p>If the same resources are references in the page but the browser rejected then, that might be SSL mismatch or similar.</p>
  
  <p>If the resources aren't requested on the second load, compare the HTML of each page and see how they differ - this suggests something happening at the CMS/CRM to alter output.</p>
  
  <p>I've seen ad blockers reject theme resources too; swapping your browser to anonymous mode or swapping to another browser can help show if the issue is browser/extension specific.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-22T15:58:49.500Z
Answers.Text: This might be the problem. But both pages in the contribution procedure use SSL. The first page, where they fill in their info is okay, but the verify page completely loses the theme. The first page is at https://...org/membership/ and the verify page is at https://...org//membership/?page=CiviCRM&q=civicrm/contribute/transact&_qf_Confirm_display=true&qfKey=...
Answers.UserDisplayName: P a u l
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-22T17:24:25.530Z
Answers.Text: Answer updated .....
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-22T19:21:02.580Z
Answers.Text: Please see my edit to the question.
Answers.UserDisplayName: P a u l
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-28T16:44:54.307Z
Answers.Text: Issue has nothing to do with SSL as it turns out.
Answers.UserDisplayName: P a u l
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-28T17:54:18.733Z
Answers.Text: Glad to hear you're eliminating some avenues at least. Can you tell us how you ruled out SSL? "Showing your work" is helpful to others trying to visualize the situation which you're supporting.
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-28T18:41:36.187Z
Answers.Text: I turned off all SSL in civicrm and wordpress. Makes no difference. The problem is with the way civicrm generates the pages, I have no documentation on the page lifecycle, etc. I don't thing I am going to get a resolution for this... or everyone is on vacation.
Answers.UserDisplayName: P a u l
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-28T18:51:01.470Z
Answers.Text: As a general rule: the more detail you provide in your question, the more likely you are to get a reply. If I'm scanning for questions to solve and one requires an additional "tell me how X is configured" round trip, I'm likely to answer the one which can be solved now. Also, frequently gathering these facts triggers a lightbulb moment - if that happens, please don't forget to update your question with the solution you discovered yourself! This is not to say you're doing badly - just to help you find a resolution by asking a the question as well as you can.
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-22T10:41:18.903Z
Answers.LastActivityDate: 2015-12-22T17:23:47.303Z
Answers.LastEditDate: 2015-12-22T17:23:47.303Z
Answers.UserDisplayName: Chris Burgess
Answers.Body: <p>I <em>believe</em> I've seen this behaviour exhibited on CiviCRM/Drupal when the <code>CIVICRM_UF</code> setting in civicrm.settings.php was misconfigured (<code>Drupal6</code> on a site running Drupal 7, or vice versa perhaps).</p>
  
  <p>This won't apply in your case since you appear to be running WordPress. However, it might be interesting to explore related avenues to the host CMS - eg CMS output functionality, and variations in versions. So:</p>
  
  <ul>
  <li>Are there plugins (eg caching, filters) which affect output on your WordPress sites and which might affect this?</li>
  <li>Can this be reliably resolved by switching the site theme? (You mention you have a custom theme purchased from a theme vendor - if so, which?)</li>
  <li>What particular version of WordPress are you running? Is it known to be compatible with the particular CiviCRM version you have?</li>
  <li><em>see if you can come up with similar questions to ask yourself ...</em></li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-29T21:14:35.027Z
Answers.Text: Running the latest version of wordpress. I did switch themes, I had to. This is renewal time for memberships and the contribution pages have to work. The theme that shows the problem is called Virtue Premium. I have switched to the Iconic One theme just so the pages load correctly. I have no idea where the problem is.
Answers.UserDisplayName: P a u l
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-28T18:57:42.923Z
Answers.LastActivityDate: 2015-12-28T18:57:42.923Z
Answers.UserDisplayName: Chris Burgess
Body: <p>In general, what would cause a contribution verification page to lose the current theme styling? This is the page that appears after our initial membership contribution page when the user presses Submit after selecting PayPal or Pay by Check. The verification page has completely lost the header, footer, everything related to the current wordpress theme. The page still functions, but looks really strange compared to the first page.</p>
  
  <p>Edit: In fact the confirm.tpl template based page is being rendered without head or body tags, it's just an html fragment. This is obviously why there is no theme on the page. As a test I switched to another theme and the page renders correctly -- so it has something to do with the theme.</p>
  
  <p>I was able to get some generous support from the theme vendor. <strong>So far there is no fix for this.</strong> Confirm.tpl doesn't load the page header, and the vendor needs to know where this usually occurs. Quote:</p>
  
  <blockquote>
    <p>Ok do you have any support with this plugin [CiviCRM]? Because the template you
    spoke of doesn't add the header. I assume they are using some kind of
    wrapper but looking at the files in the plugin they are doing this in
    a non-traditional way. What I would need to know is how they are
    forcing in the template and on what hook? For example if they are
    using a template redirect to force their template in - where is the
    template that calls in the normal wordpress functions like getting the
    header.</p>
  </blockquote>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-12-22T10:42:02.950Z
Comments.Text: I've posted two answers so you can accept / reject separately, let me know if either does the trick!
Comments.UserDisplayName: Chris Burgess
Tags: <civicontribute><wordpress><css><theme>
Title: The contribution payment verification page has lost the site theme styling
ThreadText: # The contribution payment verification page has lost the site theme styling
  
  (Asked by: username_0 on 2015-12-22)
  
  In general, what would cause a contribution verification page to lose the current theme styling? This is the page that appears after our initial membership contribution page when the user presses Submit after selecting PayPal or Pay by Check. The verification page has completely lost the header, footer, everything related to the current wordpress theme. The page still functions, but looks really strange compared to the first page.
  
  Edit: In fact the confirm.tpl template based page is being rendered without head or body tags, it's just an html fragment. This is obviously why there is no theme on the page. As a test I switched to another theme and the page renders correctly -- so it has something to do with the theme.
  
  I was able to get some generous support from the theme vendor. **So far there is no fix for this.** Confirm.tpl doesn't load the page header, and the vendor needs to know where this usually occurs. Quote:
  
  > Ok do you have any support with this plugin [CiviCRM]? Because the template you
  > spoke of doesn't add the header. I assume they are using some kind of
  > wrapper but looking at the files in the plugin they are doing this in
  > a non-traditional way. What I would need to know is how they are
  > forcing in the template and on what hook? For example if they are
  > using a template redirect to force their template in - where is the
  > template that calls in the normal wordpress functions like getting the
  > header.
  
  **Tags:** civicontribute, wordpress, css, theme
  
  > **Comments:**
  > **username_1**: I've posted two answers so you can accept / reject separately, let me know if either does the trick!  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_1 on 2015-12-29. Score: 1 | Accepted answer
  
  This relates to the custom WordPress theme you're using, whose default/CiviCRM template doesn't work as expected by CiviCRM.
  
  As Christian Wach says in his answer to [Why does CiviCRM render a validation failure without the Wordpress theme?](https://civicrm.stackexchange.com/q/2112/149), this can be resolved by adding some custom code to a plugin on your site, or by modifying your custom theme to closer match the output of WordPress default themes (which are currently the reference themes that CiviCRM is tested with).
  
  This issue can be duplicated with the [free version of the Virtue theme](https://wordpress.org/themes/virtue/) you state you're using - here's the confirm page using the [TwentySixteen theme](https://www.dropbox.com/s/0unzhqrsea8p4bn/Screen%20Shot%202016-01-04%20at%209.41.53%20am.png?dl=0) and [Virtue](https://www.dropbox.com/s/px7tgs3e16x07kc/Screen%20Shot%202016-01-04%20at%209.42.06%20am.png?dl=0) side by side.
  
  If you want to pursue using that theme, you'll need to look into addressing this - talking to the theme authors & requesting CiviCRM support would be my recommendation.
  
  EDIT: Adding code from a comment below by @username_2; this would be added to your theme's `functions.php`
  
  ```
  add_filter('civicrm_basepage_template', 'use_my_own_template_for_civi');
  
  function use_my_own_template_for_civi($template) { 
    if ($template=='page.php') { 
      return 'templates/front-page.php';
    } 
    return $template; 
  }
  
  ```
  
  I'm not sure the `templates/` prefix should be in there - perhaps a Wordpress user can confirm what works :)
  
  > **Comments:**
  > **username_0**: I am comparing 2 themes. Neither one has a the_content function. One them displays all the contribution form pages correctly (Iconic One) and the other one doesn't (Virtue Premium).  
  > **username_1**: That's good, you've isolated the issue to your custom theme at least. Next step is to work out what differs between core/working themes and the custom one that doesn't  
  > **username_1**: Answer updated (the `the_content()` references may not be helpful if the themes no longer contain that, but the basic answer stands).  
  > **username_1**: @username_0 IMO this is the correct answer for your situation, based on the discussion & comments in this thread. Please consider accepting it?  
  > **username_0**: Probably what's going on. No possibility to fix however. That wordpress/php spaghetti code just gives me a headache.  
  > **username_1**: Unfortunately not an uncommon experience with all singing, all dancing theme solutions. If you stay within narrow bounds they can work fine, but when something goes out of that bounds ... At least you have the source though!  
  > **username_2**: Just so the answer is here, the WordPress theme's not using 'page.php' (as @christian-wach [explained](http://civicrm.stackexchange.com/questions/2112/why-does-civicrm-render-a-validation-failure-without-the-wordpress-theme). Our theme uses 'templates/front-page.php' So we simply need to add the code snippet below to the bottom of our theme's "functions.php" file: `add_filter( 'civicrm_basepage_template', 'use_my_own_template_for_civi' ); function use_my_own_template_for_civi( $template ) { if ( $template=='page.php' ) { return 'templates/front-page.php'; } return $template; }`  
  
  ---
  
  ### Answer by username_1 on 2015-12-22. Score: 3
  
  Do you see `&snippet=1` in your contribute page URL?
  
  That parameter can be used to deactivate the theme on a CiviCRM page.
  
  Eg -
  
  * CiviCRM demo [donate page as per normal](http://d46.demo.civicrm.org/civicrm/contribute/transact?reset=1&id=1&action=preview) & then [without theme](http://d46.demo.civicrm.org/civicrm/contribute/transact?reset=1&id=1&action=preview&snippet=1)
  * CiviCRM [profile page as normal](http://d46.demo.civicrm.org/civicrm/profile/create?gid=1&reset=1) & same [without theme](http://d46.demo.civicrm.org/civicrm/profile/create?gid=1&reset=1&snippet=1)
  
  If that parameter is present in the link to your contribution page, remove it and see if this restores the proper theme.
  
  Does your contribute page still work without the theme?
  
  > **Comments:**
  > **username_0**: I don't see the snippet thing.  
  
  ---
  
  ### Answer by username_1 on 2015-12-22. Score: 1
  
  This might happen if you had a contribute page served over SSL, which referenced theme resources (CSS, images) which were served from a non-SSL URL.
  
  Is your site served over both SSL (https) and non-SSL (http)? If so you need to account for this when dealing with URLs throughout CiviCRM.
  
  (It's far easier, and more secure for all, to just use SSL all the time.)
  
  ---
  
  To debug this, I would load the initial page with the browser's Dev Tools open, watching the Network tab to see which resources were included. Then when you proceed to the next page, compare the activity on the Network tab there.
  
  If the same resources are references in the page but the browser rejected then, that might be SSL mismatch or similar.
  
  If the resources aren't requested on the second load, compare the HTML of each page and see how they differ - this suggests something happening at the CMS/CRM to alter output.
  
  I've seen ad blockers reject theme resources too; swapping your browser to anonymous mode or swapping to another browser can help show if the issue is browser/extension specific.
  
  > **Comments:**
  > **username_0**: This might be the problem. But both pages in the contribution procedure use SSL. The first page, where they fill in their info is okay, but the verify page completely loses the theme. The first page is at https://...org/membership/ and the verify page is at https://...org//membership/?page=CiviCRM&q=civicrm/contribute/transact&_qf_Confirm_display=true&qfKey=...  
  > **username_1**: Answer updated .....  
  > **username_0**: Please see my edit to the question.  
  > **username_0**: Issue has nothing to do with SSL as it turns out.  
  > **username_1**: Glad to hear you're eliminating some avenues at least. Can you tell us how you ruled out SSL? "Showing your work" is helpful to others trying to visualize the situation which you're supporting.  
  > **username_0**: I turned off all SSL in civicrm and wordpress. Makes no difference. The problem is with the way civicrm generates the pages, I have no documentation on the page lifecycle, etc. I don't thing I am going to get a resolution for this... or everyone is on vacation.  
  > **username_1**: As a general rule: the more detail you provide in your question, the more likely you are to get a reply. If I'm scanning for questions to solve and one requires an additional "tell me how X is configured" round trip, I'm likely to answer the one which can be solved now. Also, frequently gathering these facts triggers a lightbulb moment - if that happens, please don't forget to update your question with the solution you discovered yourself! This is not to say you're doing badly - just to help you find a resolution by asking a the question as well as you can.  
  
  ---
  
  ### Answer by username_1 on 2015-12-28. Score: 0
  
  I *believe* I've seen this behaviour exhibited on CiviCRM/Drupal when the `CIVICRM_UF` setting in civicrm.settings.php was misconfigured (`Drupal6` on a site running Drupal 7, or vice versa perhaps).
  
  This won't apply in your case since you appear to be running WordPress. However, it might be interesting to explore related avenues to the host CMS - eg CMS output functionality, and variations in versions. So:
  
  * Are there plugins (eg caching, filters) which affect output on your WordPress sites and which might affect this?
  * Can this be reliably resolved by switching the site theme? (You mention you have a custom theme purchased from a theme vendor - if so, which?)
  * What particular version of WordPress are you running? Is it known to be compatible with the particular CiviCRM version you have?
  * *see if you can come up with similar questions to ask yourself ...*
  
  > **Comments:**
  > **username_0**: Running the latest version of wordpress. I did switch themes, I had to. This is renewal time for memberships and the contribution pages have to work. The theme that shows the problem is called Virtue Premium. I have switched to the Iconic One theme just so the pages load correctly. I have no idea where the problem is.  
  
  ---
  
  