Forum Replies Created
-
There is comments in the code that says where to put the menu location. You will need to locate where your main menu location is in your particular theme. Get this all working and then we can expand it to include more features 🙂
in reply to: Display Logout Link After Loginumberto86 you will want to place that code into your functions.php and change the main menu location to your themes main menu location. Then change the link url’s of course and you should be good to go. I have greatly expanded this function since I last posted it. I have added functionality to it to work with the private messaging add on so that when you click the drop down menu it will show a “Messages” link and if you have new messages it will show that number in parenthesis like this.. Messages (1) etc.. if there is no new messages then it simply just says Messages. Let me know if you are interested in that too.
in reply to: Display Logout Link After LoginI wrote a function to do this. Its a little more complex then what’s above but I have also included drop down navigation under the users name that is displayed. Log out and My Profile are some of the sub nav links. Code doesn’t display correctly so don’t copy and past this haha. This also uses the log in pop up. Here is the jfiddle link if you are interested in using it. http://jsfiddle.net/HZscB/
PHP12345678910111213141516171819202122232425262728293031323334353637383940/*Add Login / Logout to your WordPress Menu*/function userpro_add_loginout_navitem($items, $args ) {$theme_location = 'avia'; //Change "avia" to your theme's main menu location$current_user = wp_get_current_user();if( $args->theme_location == $theme_location ) {if ( !(is_user_logged_in()) ) {$login_item = '<li class="nav-login menu-item"><a href="/profile/#" class="popup-login">Log In</a></li>'; //login display$login_item .= '<li class="nav-login menu-item"><a href="/profile/register">Register</a></li>'; //login display}else {//$login_item = '<li class="nav-login menu-item">'.wp_loginout($_SERVER['REQUEST_URI'], false).'</li>'; //logout display//$login_item = '<li class="nav-login menu-item">'.echo $current_user.'</li>'; //logout display$login_item = '<nav>';$login_item .= '<ul>';$items .= '<li><a href="#">'.$current_user->user_firstname.' '.$current_user->user_lastname.'</a>';$items .= '<ul>';$items .= '<li><a href="/profile/">My Profile</a></li>';$items .= '<li><a href="/my-projects/">My Projects</a></li>';$items .= '<li><a href="/create-project/">Create Project</a></li>';$items .= '<li class="nav-login menu-item">'.wp_loginout($_SERVER['REQUEST_URI'], false).'</li>';$items .= '</ul>';$items .= '</li>';$items .= '</ul>';}$items .= $login_item;}return $items;}add_filter('wp_nav_menu_items', 'userpro_add_loginout_navitem', 10, 2);in reply to: Display Logout Link After LoginI wrote mine like this
PHP12345678910111213141516171819202122232425262728293031323334353637/*Add Login / Logout to your WordPress Menu*/function userpro_add_loginout_navitem($items, $args ) {$theme_location = 'avia'; //Change "main_menu" to your own theme's main menu location$current_user = wp_get_current_user();if( $args->theme_location == $theme_location ) {if ( !(is_user_logged_in()) ) {$login_item = '<li class="nav-login menu-item"><a href="/profile/#" class="popup-login">Log In</a></li>'; //login display$login_item .= '<li class="nav-login menu-item"><a href="/profile/register">Register</a></li>'; //login display}else {//$login_item = '<li class="nav-login menu-item">'.wp_loginout($_SERVER['REQUEST_URI'], false).'</li>'; //logout display//$login_item = '<li class="nav-login menu-item">'.echo $current_user.'</li>'; //logout display$login_item = '<nav>';$login_item .= '<ul>';$items .= '<li><a href="#">'.$current_user->user_firstname.' '.$current_user->user_lastname.'</a>';$items .= '<ul>';$items .= '<li><a href="/profile/">My Profile</a></li>';$items .= '<li><a href="/my-projects/">My Projects</a></li>';$items .= '<li class="nav-login menu-item">'.wp_loginout($_SERVER['REQUEST_URI'], false).'</li>';$items .= '</ul>';$items .= '</li>';$items .= '</ul>';}$items .= $login_item;}return $items;}add_filter('wp_nav_menu_items', 'userpro_add_loginout_navitem', 10, 2);This actually shows the users first and last name when they log in and then when you hover over it it brings down a dropdown menu with my profile a project creation link which is specific to my clients needs, and the log out 🙂 works nicely.
in reply to: Change login button for username when userloginI want to make the large social icons like in the link I posted, but how do I get them to appear on the popup login and registration for user pro? I can add shortcode for them above the login short code and such but I want them on the actual pop up for Facebook, instead of the little square with the F. My link just shows screenshots of how I would actually like to make it look. For login:
_____________________________
| Log in With Facebook |
|____________________________|———– OR ————–
Username fields
Password fieldslog in button
and for registration
| Sign Up With Facebook |
|____________________________|———– OR ————–
signup with email link (could just be the registration button on the user pro log in page.
Thank you,
Jacob Mapson
JMTECH GLOBALin reply to: large social buttons on popup login/registrationlink didn’t show up sorry. http://client-traca.jmtechglobal.com/?p=331
in reply to: large social buttons on popup login/registrationHow do I get the regular fields to display on the posts then? The way I have it working now I get the custom fields along with a bunch of other fields I didn’t create or populate on the post.
Thank youin reply to: Custom FieldsI tried doing this and it only pops up for me once in awhile. It is weird that it works sometimes but not others. Here is a jfiddle of my code. The first function already existed in my functions.php file and is where I got the “theme’s main menu location” from. The second function is the one you posted with that change made. http://jsfiddle.net/Xzk7e/
If you could please tell me if you notice my error or why its not working properly it would be greatly appreciated.
The website I am working on is client-traca.jmtechglobal.comThank you
in reply to: Add Class=popup-login