Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • in reply to: JSON error Woocommerce checkout #182312
     Simon2902
    Participant
    Not marked as solution
    in reply to: Paid Membership Pro & Buddypress Registration #173337
     Simon2902
    Participant

    Hi @Radu

    I have used your code for the same purpose as outlined by @samuelhatton. Unfortunately the code interrupts the correct loading of the homepage. The head loads but not the content. When refreshing the page, the content loads successfully. I am using the code below in functions.php of the child theme to use a different homepage for users (buddypress activity) than for visitors.

    COPY CODE
    // set activity as homepage for logged in users
    function switch_homepage() {
        if ( is_user_logged_in() ) {
            $page = 6; // for logged in users
            update_option( 'page_on_front', $page );
            update_option( 'show_on_front', 'page' );
        } else {
            $page = 9517; // for logged out users
            update_option( 'page_on_front', $page );
            update_option( 'show_on_front', 'page' );
        }
    }
    add_action( 'init', 'switch_homepage' );

    Do you have any suggestions please? Thanks.

Viewing 2 posts - 1 through 2 (of 2 total)

Log in with your credentials

Forgot your details?