• is it possible to redirect a user with “read” capability to the main homepage, from the wplogin.php
    and the admin to the admin section

    i found this…

    Open your wordpress/wp-login.php file, and find this line:
    $redirect_to = admin_url();
    
    and replace it with this:
    
    $redirect_to = get_option('siteurl');

    but this also redirects the admin to the main page…

    and in the main homepage i have a horizontal menu button that says members, and when the “member” is logged in i would like the membercontent + member logout in a list… but how to combine that?
    i’ve got:

    <?php if(current_user_can('read')){ ?>
    	<li><?php wp_list_pages('&exclude=104&sort_column=menu_order&title_li='); ?></li>

    how to insert a logout button?

Viewing 1 replies (of 1 total)
  • Thread Starter dotblend

    (@dotblend)

    <?php if(current_user_can('read')){
                <a href="https://www.somewebsite.com/wp/wp-login.php?action=logout">logout</a></li>
    			<?php wp_list_pages('&exclude=104&sort_column=menu_order&title_li&depth=2'); ?></li>
    			<?php wp_list_categories('orderby=name&title_li&include=125,9&depth=2');?> </li> {
    		  } else {
              			<a href="https://www.somewebsite.com/wp/wp-login.php">login</a> ; } ?>
    			<?php } ?>

    why does this not work? any help?

Viewing 1 replies (of 1 total)
  • The topic ‘redirect on login (not to profile or dashboard)’ is closed to new replies.