How to Add a Login/Logout Link to WordPress Menu

| Last Updated: | In: Wordpress, WP Labs


In this post, I will show you how to add a login / logout link to the your WordPress navigation menu. This code snippet automatically detects whether the user is logged in or not and display the login or logout link accordingly.

This is the very easy and simple code which will save tone of times from adding login/logoout link manually in menu bar.

Login-logout-menu

No plugin needed, add it to the theme’s functions.php file

Add the following code to your theme’s functions.php file and change the menu area name if you are not using “primary“. For WordPress 3.0 and up.

Tags: , , , , ,


About: Prem Tiwari

Prem Tiwari is founder of freewebmentor.com and Software developer from New Delhi (India). Follow Prem's development codes on facebook, and make sure you check out freewebmentor.com for the latest in web development related Tips with the complete code.


You may also like:

Follow us!

Get Free Access of 350+ Scripts

Don't worry you'll not be spammed!

Featured eBook

WordPress Security Guide

Learn how to implement security guideline in your WordPress site...

DOWNLOAD

Pincode Finder

pincode-finder tool

Online Pincode Finder

Best tool to locate post Office address and pincodes of all india...

SEARCH NOW