Hi
using the wp_login_url() - for getting login url, if you want to redirect to the current page after login means . use
wp_login_url(get_permalink()); ,
Quote:
<a href="<?php echo wp_login_url( get_permalink() ); ?>" title="Login">Login</a>
the above code can include in index page ,where there loop for display all post,you may call this function .
do want to redirect to external page you have to use reidrect parameter like thisCode:
<?php
$Path=$_SERVER['REQUEST_URI'];
$URI='http://www.example.com'.$Path;
<a href="<?php echo wp_login_url( get_permalink() ).'redirect_to='.$URI"; ?>" title="Login">Login</a>
?>
same for logout function ,
Code:
<?php
$Path=$_SERVER['REQUEST_URI'];
$URI='http://www.example.com'.$Path;
<a href="<?php echo wp_logout_url( get_permalink() ).'redirect_to='.$URI"; ?>" title="Login">Login</a>
?>