Change WordPress menu based on browser cookie

So I am dev. an application on http://codepigeon.com.

The All the static content is handled through WordPress and the App is located on http://app.codepigeon.com. Now when a user has loged into app.codepigeon.com he will get a cookie stored in his browser.

Read More

When this loged in user comes back to codepigeon.com he should not see the devault mene like (login, register, features …) but a different menue like (account dashboard logout – wich are linked to app.codepigeon.com)

How could I do this?
Is there a wordpress plugin for this?

Thanks

Related posts

Leave a Reply

1 comment

  1. I would just do an if/else statement that checks for the cookie then displays the correct menu.

    If you create the custom menus from your dashboard and name them “LoggedInMenu” and “NotLoggedInMenu”, your code would look something like this:

    <?php
    if (isset($_COOKIE["your_cookie_name"]))
        wp_nav_menu( array('menu' => 'LoggedInMenu' ));;
    else
        wp_nav_menu( array('menu' => 'NotLoggedInMenu' ));
    ?>