Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-10682

Let frontend WordPress pages use template other than home page


    • Type: Patch
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.1.5
    • Fix Version/s: 4.3.4
    • Component/s: WordPress Integration
    • Labels:


      There are two ways of generating front-facing CiviCRM pages: one is to create a page in WordPress, click the CiviCRM logo, and set it to show an event or contribution form. The other (which CiviCRM does automatically when you click through to subsequent steps in registration) basically displays the homepage, removes the page's content, and drops the CiviCRM content in.

      It adds "/?page=CiviCRM&q=[internal CiviCRM path like in Drupal]" to the base URL, so that's why it uses the homepage template, but doing something like http://your-wordpress-site.org/about?page=CiviCRM&q=[civipath] will use the template for http://your-wordpress-site.org/about.

      This is useful for two reasons:
      1. Often sites have different subthemes for each section, so your donation page should share the look and feel of the appropriate section.
      2. Often sites have a radically different homepage template from their other pages. The home page template may be uniquely ill-suited for having CiviCRM content dropped in.

      So, what I've done is added a piece to let you define a page that'll be the base page for CiviCRM forms. It's meant to be something you can set in civicrm.settings.php--just add:
      define( 'CIVICRM_UF_WP_BASEPAGE', 'about');

      That'll mean that internal links-like from the event info page to the registration form, or from the contribution form to its confirmation page-will have the right page template.


        1. wp-basepage.diff
          0.5 kB
          Andrew Hunt
        2. wpbasepageadmin.diff
          2 kB
          Andrew Hunt



            • Assignee:
              kurund Kurund Jalmi
              andrewhunt Andrew Hunt
            • Votes:
              0 Vote for this issue
              8 Start watching this issue


              • Created: