Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Need to disable the user access to wordpress admin panel

  • Avatar of Paul
    Paul
    Participant

    @rhododendron

    I need to disable the user access to wordpress admin panel. I do not want them to look into my site’s backend.

    from login to all the buddypress activities I want in only on-page.

    Is it possible to do so?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Avatar of henrywright
    henrywright
    Participant

    @henrywright

    Try using Theme My Login – you can have registration, login, lost password and reset password all within your themed pages.

    Disabling access to WP Admin will require some custom code. Put this in your theme’s functions.php file:

    // disable access to wp-admin for non-administrators
    function block_wp_admin_access() {
        if ( is_admin() && ! current_user_can( 'administrator' ) && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
            wp_redirect( home_url() );
            exit;
        }
    }
    add_action( 'init', 'block_wp_admin_access' );
    Avatar of Paul
    Paul
    Participant

    @rhododendron

    Awesome!

    Thanks for that quick reply.

    I have another question. Sorry it is silly I know. As I am new to buddypress I am taking some time reading all the docs. The question is if I make any modification in the front end views for the buddypress installation I guess I need to do in a child theme so that the modifications doesnt go off with the new releases of buddypress. But where do I do it. I mean I read that the new releases of buddypress supports any wordpress theme compatibility I can rather do this modifications inside my website childtheme itself I suppose.

    But waht about the directory structures? How that should be. do I need to make a directory inside my child theme. Can you please tell how it works?

    Avatar of bp-help
    bp-help
    Participant

    @bphelp

    @rhododendron
    In your child theme you would copy over the buddypress folder. Please review:

    http://codex.buddypress.org/themes/theme-compatibility-1-7/a-quick-look-at-1-7-theme-compatibility/

    Once that folder as well as subfolders are in place then you can modify it without it getting overwritten in future updates. Just make sure the directory structure stays the same.

    Avatar of Paul
    Paul
    Participant

    @rhododendron

    Just make sure the directory structure stays the same.

    I have copied the buddypress folder from the plugin to Theme-child folder.
    I read the codex too. But doesnt tell anything about the directory structure. do you mean that I need to create a pluin folder inside my child theme.

    now my directory structure is
    themes–>hueman-child–>buddypress

    This is what you meant right?
    Correct me if I am wrong.

    Avatar of bp-help
    bp-help
    Participant

    @bphelp

    @rhododendron
    Yes that is correct. If you have subfolders within the buddypress folder also make sure the structure is the same as it was when you copied it over. Otherwise if you change the templates it will not work correctly.

    Avatar of Paul
    Paul
    Participant

    @rhododendron

    Thanks a lot. :)

    Avatar of Paul
    Paul
    Participant

    @rhododendron

    I have another question.

    If I want to remove wordpress logo from the top wordpress bar where the buddypress activity dropdown shows, I want to place my website logo there. what I need to do. Is that possible.

    Avatar of Paul
    Paul
    Participant

    @rhododendron

    This question awaits an answer. Sorry for bumping.

    Avatar of Paul
    Paul
    Participant

    @rhododendron

    Okay

    I did it

    function annointed_admin_bar_remove() {
            global $wp_admin_bar;
    
            /* Remove their stuff */
            $wp_admin_bar->remove_menu('wp-logo');
    }
    
    add_action('wp_before_admin_bar_render', 'annointed_admin_bar_remove', 0);

    Thought of to give the solution if anybody needs it.

Viewing 9 replies - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.