• I have a new wordpress site, and I’m testing it with a “test subscriber”. When my subscribers login-in, they are automatically sent to the admin profile page. I want them to be directed to the home page after login, and not the their profile page. How can I fix this? I’m very new to wordpress and I am not that knowledgeable about it. Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator t-p

    (@t-p)

    and I’m testing it with a “test subscriber”.

    can you explain “test subscriber”

    Thread Starter retired2006

    (@retired2006)

    I just created a new “user” and login with one of my other email accts. As if it was a real subscriber. I figured it would be the best way to see the site as my family would see it (its going to be a family site), and a lot of them can get confused very easily. ??
    thanks, Jim

    Moderator t-p

    (@t-p)

    Try adding this to your theme’s functions.php file…

    /* redirect users to front page after login */
    function redirect_to_front_page() {
    global $redirect_to;
    if (!isset($_GET['redirect_to'])) {
    $redirect_to = get_option('siteurl');
    }
    }
    add_action('login_form', 'redirect_to_front_page');
    Thread Starter retired2006

    (@retired2006)

    Thanks Tara, but I have to admit I’m not very knowledgeable when it come to PHP. I think I can find the theme’s function file, but is there a special place to put those lines, or can I put them anywhere?

    Here is my function file:

    <?php
    /**
    *
    * This program is free software: you can redistribute it and/or modify
    * it under the terms of the GNU General Public License as published by
    * the Free Software Foundation, either version 3 of the License, or
    * (at your option) any later version.
    *
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    * GNU General Public License for more details.
    *
    * You should have received a copy of the GNU General Public License
    * along with this program. If not, see <https://www.gnu.org/licenses/&gt;.
    *
    *
    * @package WordPress
    * @subpackage TravelBlogger
    * @since TravelBlogger Theme 1.0
    */

    // Define directory constants
    define(‘EXP_LIB’, get_template_directory() . ‘/lib’);
    define(‘EXP_ADMIN’, EXP_LIB . ‘/admin’);
    define(‘EXP_FUNCTIONS’, EXP_LIB . ‘/functions’);
    define(‘EXP_CLASSES’, EXP_LIB . ‘/classes’);

    // Launch Theme within WordPress
    require_once(EXP_FUNCTIONS . ‘/launch.php’);

    // Load theme functions
    require_once(EXP_FUNCTIONS . ‘/layout.php’);
    require_once(EXP_FUNCTIONS . ‘/components.php’);
    require_once(EXP_FUNCTIONS . ‘/widgets.php’);

    if(is_admin()) {
    // Adds options to Appearance tab in admin area
    require_once(EXP_ADMIN .’/opt_theme_layout.php’);
    require_once(EXP_ADMIN .’/opt_colors_fonts.php’);
    require_once(EXP_ADMIN .’/opt_social_media.php’);
    // Loads classes
    require_once(ABSPATH . ‘wp-admin/custom-header.php’);
    require_once(ABSPATH . ‘wp-admin/custom-background.php’);
    require_once(EXP_CLASSES . ‘/custom-background.php’);
    require_once(EXP_CLASSES . ‘/custom-header.php’);
    require_once(EXP_CLASSES . ‘/custom-footer.php’);
    // Adds admin only functions
    require_once(EXP_FUNCTIONS .’/admin.php’);
    }

    Moderator t-p

    (@t-p)

    but is there a special place to put those lines, or can I put them anywhere?

    anywhere

    If you have not already done, consider creating a child theme

    Also, make sure to backup copy of your template before making any changes, in case.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Home Page Help’ is closed to new replies.