1

I got something quite strange and do not how to solve it. In my Wordpress 5.6.1 /CiviCRM 5.34 integration (my first WP integration but have am also working with D7/Civi for 8+ years) I get a double registration screen. It shows in the main area AND in the footer.

I am using the native url and not the shortcode. https://www.mydomain.nl/civicrm/event/register/?reset=1&id=12

UPDATE: it is only when I use a selected page as a footer in my enfold theme

enter image description here

1

You could use JetPack or another widget visibility plugin to prevent showing the page in the footer when you're on the CiviCRM Base Page.

EDIT: The following code prevents CiviCRM from overriding the content a second time:

add_action( 'civicrm_basepage_parsed', 'my_civicrm_disable_content_filter' );

function my_civicrm_disable_content_filter() {
    // Once the CiviCRM filter has run, remove it.
    add_filter( 'the_content', 'my_civicrm_remove_content_filter', 100 );
}

function my_civicrm_remove_content_filter( $content ) {
    static $done;
    if ( ! isset( $done ) ) {
        remove_filter( 'the_content', [ civi_wp()->basepage, 'basepage_render' ] );
        $done = true;
    }
    return $content;
}

This should mean that your second page renders as expected.

2
  • @richard-van-oosterhout Add the code above in your functions.php file (maybe replacing my_ with your child theme's custom prefix) and your issue should go away on the base page. If you use Shortcodes, I'll update with further code to fix that. – Christian Wach Feb 17 at 12:23
  • Also, you may want to look at the PR I've just opened for a simpler solution: github.com/civicrm/civicrm-wordpress/pull/240 – Christian Wach Feb 17 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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