• Resolved bluesmokellc

    (@bluesmokellc)


    I’m using a theme purchased on Themeforest. I want my subscribers to be able to edit their profile from the dashboard, but when they try to go to https://pearnet.co/wp-admin/profile.php they get sent back to the homepage, even if they’re logged in. I think the theme is causing this, but I can’t figure out how to fix it. Any ideas?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Can you replicate the problem using the default Twenty Fourteen theme with all plugins deactivated?

    I’m sorry but if this is a theme issue, you will need to seek support from the theme’s developer/vendor. We do not support commercial products here.

    Thread Starter bluesmokellc

    (@bluesmokellc)

    No I can’t, so it’s either a theme or a plugin issue. And the theme developer hasn’t answered any support requests in months (this is what I get for not properly vetting the theme before buying it).

    Let me rephrase the question in a way that satisfies your forum rules (which are completely reasonable):

    How would you redirect subscribers to the home page when they try to access the dashboard?

    I wouldn’t. Full stop. Try just deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    Thread Starter bluesmokellc

    (@bluesmokellc)

    I tried that. It was the theme.

    Here is what I found in the theme’s functions.php file:

    function wpse_11244_restrict_admin() {
        if ( ! current_user_can( 'manage_options' )  && $_SERVER['PHP_SELF'] != '/wp-admin/admin-ajax.php' ) {
            wp_redirect( home_url() );
        }
    }
    add_action( 'admin_init', 'wpse_11244_restrict_admin', 1 );

    As you can see, the function is redirecting users that don’t have admin privileges to the homepage. If you are building a website that has members and you want them to edit their profile from the frontend, check out the free version of ProfileBuilder and Advanced Access Manager. Those two plugins combined will do the trick.

    Thanks again for nothing, WordPress “Support” forum.

    We do not have access to, nor do we support, commercial themes as you paid for support when you bought the theme. It is not our place to keep theme vendors in business or deprive them of any income that they may derive from support services.

    Thread Starter bluesmokellc

    (@bluesmokellc)

    And I already agreed that rule is fair. But I wasn’t asking you to support the theme. I was asking what function would someone use to accomplish this, so I could find it and delete it.

    The correct answer was “restrict_admin()” which I found thanks to some helpful people at wordpress.stackoverflow.com.

    Like I said, the rule makes sense, but you’re using it as an excuse to not be helpful in a matter where it does not apply. If I had never mentioned the theme in the first place, and only asked for the function, would you have still brushed me off?

    I get that you probably deal with hundreds of these mundane threads every day, and that has left you jaded, so I apologize for any hostility caused by my frustration. I appreciate the work that you do.

    The correct answer was “restrict_admin()”

    And how are we supposed to know that given that we cannot access the theme?

    Thread Starter bluesmokellc

    (@bluesmokellc)

    Personal experience with WordPress?

    Oh – I wish! After more than ten years of working with WP, there’s no way I could diagnose that without access to the theme.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Subscribers redirected to home page’ is closed to new replies.