• Resolved guwd

    (@guwd)


    Hello,

    Got a fresh installation of WP. Plugins, beyond Ultmiate Member are: YOAST, Smush, Defender Pro, Wp form lite, SG Optimizer.

    Running on theme “Neve”. Everything works good, except that I can’t restrict the page where my blogpost are. I tried to create a new page named “test”, restriction works fine. Changed the post site to “test” for the blog in WP-settings, then I can access test without restrictions. I can restrict every page, but not the one where my blog posts appear.

    I have tried:
    – Change to twenty twenty/twentyone theme
    – disabled every plugin except UM
    – enable/disable Gutenberg support for UM

    Nothing seems to fix it… What more can I do?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @guwd

    Are you trying to restrict the archive page? Could you please provide the URI of your blog post archive?

    Regards,

    Thread Starter guwd

    (@guwd)

    Hi @champsupertramp

    Have a look at https://staging2.brfhaganova.se/test/ (landning page for blog post).

    Thanks

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @guwd

    Sorry for the late response.

    How do you want to restrict the Posts page? Do you want to redirect guest users from the test page to the login page when accessing the Posts page? Or do you still want guest users to access the page but restrict each post?

    Regards,

    Thread Starter guwd

    (@guwd)

    Hi @champsupertramp

    Preferable to redirect to login, as ie https://staging2.brfhaganova.se/nyheter.

    (If a workaround is needed to restrict every post, that works as a worst case scenario. See https://staging2.brfhaganova.se/trello-for-freelancers/ that has been restricted.)

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @guwd

    Did you restrict this page manually? What is the content restriction set to it? Is it an Archive page or a post?
    https://staging2.brfhaganova.se/nyheter

    Also, Is this page archive or a post?
    https://staging2.brfhaganova.se/trello-for-freelancers/

    Regards,

    Thread Starter guwd

    (@guwd)

    @champsupertramp I restricted both pages in the same way, down below the content edioter there is “UM Contentrestriction” (got it in Swedish so unsure of exact translation). See print screen https://imgur.com/a/VDQJ0gv

    Both URLs are PAGES not posts, but at the moment “test” is now set as the postage, ie the blog posts are displayed there.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @guwd

    Sorry for the late response. We’ve been busy going through each topic so it took some time to get back on your topic.

    Could you please confirm that you want to restrict the blog page? This will require a custom code to restrict it or redirect to the login page.

    Feel free to re-open this thread by changing the topic status to “Not Resolved” so that we can get back to you.

    Regards,

    Thread Starter guwd

    (@guwd)

    Hi,

    No worries. Yes – I would like to restrict the blog page. Please let me know what code I need ??

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @guwd

    Sorry for the late response.

    You can try adding this code snippet on your theme’s function.php file or use the Code Snippets plugin to run the following code:

    add_action("template_redirect", function(){
       if ( !is_front_page() && is_home() && function_exists("um_get_core_page") && ! is_user_logged_in() ) {
           wp_redirect( um_get_core_page("login") );    
           exit; 
       }
    });

    The above code will redirect non-logged-in users to UM login page when visiting the Blog page. The blog page should be added a Post page in WP-Admin > Settings > Reading > Your homepage displays > “Static” > Posts page.

    Regards,

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @guwd

    Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. ??

    Regards,

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Unable to restrict post page’ is closed to new replies.