WordPress.org

Ready to get started?Download WordPress

Forums

Customisation of login/logout/posting (4 posts)

  1. PhillipH
    Member
    Posted 9 years ago #

    heya,

    love the application. What im trying to do is customise login/registration and logout.

    Basically look at my menu top right at http://www.theprogrammersforum.com

    theres :

    * Login
    * Post/Edit Article
    * Register
    * Logout

    ive already done it so that when you login you are brought to the site, and not straight into admin.

    logout goes to the wp-login.php - what i need there is the code to clear the cookies and then return to the main page (index.php).

    also when the user is logged in - login and register links not to display., and when they are Not logged in the Post/Edit Article is not displayed.

    its ironic that my site is about programming :-) but im an asp programmer lolol. ah well i can but try lol

  2. PhillipH
    Member
    Posted 9 years ago #

    ok i figured out the logout with no problem, but im struggling with checking whether they are logged in/out in the index file - so i can show/hide particular menu choices. Any clues? :)

  3. PhillipH
    Member
    Posted 9 years ago #

    anyone able to help with this? i know i have to check if the cookies are on the users machine, but its the code im struggling with (to be put in the index file)

  4. PhillipH
    Member
    Posted 9 years ago #

    ok guys i worked it out. If anyone wants a menu like mine then here it is. Edit the main file Index.php and change your menu to :

    <?php get_currentuserinfo(); ?>

    <ul>
    <li id="other">

    <ul>
    <li><a>/index.php"><?php _e('Home'); ?></a></li>
    <?php<br />
    if ( $user_nickname== "" ) {<br />
    ?>

    <li><a>/wp-login.php"><?php _e('Login'); ?></a></li>
    <li><a>/wp-register.php"><?php _e('Register'); ?></a></li>
    <?php<br />
    }<br />
    if ( $user_nickname<> "" ) {<br />
    ?>

    <li><a>/wp-login.php"><?php _e('Post/Edit Article'); ?></a></li>
    <li><a>/wp-login.php?action=logout"><?php _e('Logout'); ?></a></li>
    <?php<br />
    }<br />
    ?>
    </ul>
    </li>

    Hope you like it. Took me long enough. I guess it was about time i learned some php :)

    hm ok i cant post this properly. if anyone wants the code then please mail me at philliph@theprogrammersforum.com

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.