This topic has 4 replies, 2 voices, and was last updated 6 years by felix.

  • Author
  • #188825
     felix
    Participant

    Hi there.

    When I turn on Private Site option in the Theme Options Panel I can include page exceptions and it works fine.

    But the problem is that any event simple page redirects non-logged users to the custom redirect login page.

    Can I set event simple pages as an exception as well?

    Thans in advance!

    #188930
     Kieran_SQ
    Moderator

    Hi,

    Currently the Restrict My Site plugin does not support allowing singular custom post types to be set as an exclusion. If you needed a custom post type to be viewable you will need to look at alternative options to our plugin.

    If you would like I can add this ticket to the feature request queue for the community to vote on? Let me know.

    Thanks,

    Kieran

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #188948
     felix
    Participant

    Thank you Kieran.
    And could you please provide me a function or hook to include these exceptions manually in my installation code?

    #188950
     Kieran_SQ
    Moderator

    Hi,

    With Restrict My Site disabled you could extend this code to suit your needs. This is for BuddyPress by default but you can change the conditions to suit your needs.

    To open up your post type and any others you would need to use
    is_singular( array( 'post-type-name', 'other-post-type-name' ) )
    you can read more about that here https://codex.wordpress.org/Function_Reference/is_singular

    COPY CODE
    // Redirect to register if logged out and page is BuddyPress
    function kleo_page_template_redirect()
    {
        //if not logged in and on a bp page except registration or activation
        if( ! is_user_logged_in() &&
            ( ( ! bp_is_blog_page() && ! bp_is_activation_page() && ! bp_is_register_page() ) )
        )
        {
            wp_redirect( home_url( '/register/' ) );
            exit();
        }
    }
    add_action( 'template_redirect', 'kleo_page_template_redirect' );

    Thanks,

    Kieran

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #188966
     felix
    Participant

    Thank you.
    I´ve added this code to your conditional:

    && !is_page( $page_array_ids ) && $_SERVER[‘PHP_SELF’] != ‘/wp-admin/admin-ajax.php’

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

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?