Skip to:
Content
Pages
Categories
Search
Top
Bottom

Different page redirect (not wp login page)?

  • Avatar of Miko
    Miko
    Participant

    @mikosoft

    All is working great except I want to redirect to a different page instead of the default wp login page. I have tried editing the private-buddypress.php file, but I can’t seem to get my edits to line 94 to work. What do I put instead of siteurl in order for it to redirect to my custom 404.php page which I have sitting in my theme folder?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Avatar of Miko
    Miko
    Participant

    @mikosoft

    As an alternative, is there a way to redirect to a WordPress page (rather than what I was trying to do , which is redirect to my custom 404 page)?

    Avatar of danbpfr
    danbpfr
    Participant

    @chouf1

    take a look in wp-config.php

    Avatar of Miko
    Miko
    Participant

    @mikosoft

    well that’s not really helping me unless I know what I am looking for. it doesn’t seem to make sense for me to look at the wp-config file when what I am trying to change is how the plugin functions. i want to know if i can change this bit of code within private-buddypress.php:
    `wp_redirect(get_option(‘siteurl’) . ‘/wp-login.php?redirect_to=’ . $redirect_to);`
    to redirect to a page other than the login page. i have tried putting other pages there but i get an infinite looping problem. clearly i am doing it wrong but not sure what needs changing.

    Avatar of Dennis Morhardt
    Dennis Morhardt
    Participant

    @gigalinux

    Added in 1.0.3, add this to your functions.php:

    `function redirect_nonloggedin_users($current_uri, $redirect_to) {
    // Redirect users to the homepage
    // Caution! Exclude the homepage from ‘Private BuddyPress’ options
    // to avoid redirection loops!
    return get_option(‘siteurl’) . ‘/?from=’ . $redirect_to;
    }

    add_filter(‘pbp_redirect_login_page’, ‘redirect_nonloggedin_users’, 10, 2);`

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

You must be logged in to reply to this topic.