Edit message for non logged-in visitors on post page

Hi there,
I've chosen to have my site (www.SeafoodIntell.com) protected with Membership (great plugin by the way!) and to have the front page display the posts (news articles) since its a news website. [PS: I want to leave it that way as the post are very dynamic & change constantly which is what one expects of a news site. I don't want a static page as a homepage, which would solve the query below]

However & since the viewing of posts is not authorised for non-subscribers, I have a message permanently displaying:

" Nothing Found - It seems we can’t find what you’re looking for. Perhaps searching can help. + Search button"

I'd like to edit this message since this is what apeears on the homepage & is not very attractive for non-subscribers (but prospective ones hopefully).

How can I change/edit the message above ("nothing found...") & give it a bit more substance?

Thanks for any suggestion & help,

  • aristath

    Hello there @Bertrand, Ih ope you're well today!

    You can custom-code a solution like this:

    function redirect_anonymous_users() {
    	$url   = '/register'
    	$level = 1
    	$redirect_to = home_url() . $url;
    	if ( function_exists( 'current_user_on_level' ) && current_user_on_level( $level ) || ! current_user_is_member() ) {
    		wp_redirect( $redirect_to );
    add_action( 'wp', 'redirect_anonymous_users' );

    This will redirect all users that belong to a specific access level or have no level, to a specific page on your site.
    You can configure which page it will redirect to and what your free level is by editing these 2 lines:

    $url   = '/register'
    $level = 1

    I hope that helps!


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.