My Home in Main Menu
- This topic has 8 replies, 2 voices, and was last updated 11 years, 1 month ago by .
Viewing 9 posts - 1 through 9 (of 9 total)
Viewing 9 posts - 1 through 9 (of 9 total)
- You must be logged in to reply to this topic.
Is there any way to add a ‘My Home’ tab in the main menu that would take logged in members back to their own profile page. I appreciate these links are dynamic in that each ‘My Home’ needs to link back to a different page based upon the username but I would really appreciate knowing whether or not there is a solution.
So far users are diverted straight to their profile upon logging in but when they leave that page they need to find themselves in members or the home page log in and click on their name to navigate back again. More importantly members who activate their account are stranded on the activation until they work out how to track their profile page down.
Maybe I just haven’t work the system out, so all advice gratefully accepted 🙂
Hi Sam,
Don’t you have the WP Admin bar enabled? Just like on this site you would have a nice user menu on the top right of every page. I think that makes the most sense from an UX standpoint. If you really need that custom link in the menu, let me know, and I’ll look if I can figure something out for you 🙂
Hi Bowe, If you could sort something out for me that would be absolutely fantastic.
Hi Sam,
I’ve written a tutorial to help you and possibly others with getting this done. Check it out here:
https://commonsinabox.org/archives/3329
Hope this helps!
You are a star, thank you I really appreciate you bailing me out. Just one more question. Having got my child theme the menus on the front end were all over the place as your guide said they would be but in the back (admin) end they looked as normal. Have I panicked too quickly, should I have just re-saved the menu to restore it?
No problem Sam!
The menu’s are still there you just need to re-assign them to the right Menu Locations. See the attached screenshot (assuming you’re on WP 3.7)
I’m really sorry you’re having to baby me through this … but now I’ve sorted the menus (thank you), I can’t alter logo, favicon etc. Every time I go into CBOX theme options, clicking on Start; Options;User Doc; or Dev Doc, I open up a new window that is completely blank bar a O in the top left hand corner. Looks like the student is a long way from becoming the master!
I have read the comments on Possible CBOX Theme Options bug resulting from upgrade to WordPress 3.6. so issue resolved. Thanks again.
@Bowe sorted adding this to my main menu and it works brilliantly. I have the rest of my menu in bold and I would like the My Profile/My Home tab to be the same. Where/how would I alter the font weight from normal to bold.
/**
* Add a Custom “My Profile” link to the Main Menu
*
*/
function cbox_custom_profile_menu_item ( $items, $args ) {
if ($args->theme_location == ‘main-menu’) {
$profilelink = ‘<li class=”my-home-menu”>‘ . __(‘My Home’) . ‘‘;
$items .= ”;
$items = $items . $profilelink;
}
return $items;
}
add_filter( ‘wp_nav_menu_items’, ‘cbox_custom_profile_menu_item’, 10, 2 );
Apologies for what is probably a very basic question but as I am prone to taking my site off air with my guessed at coding, I thought it best to ask the experts.