locomoco
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How do I add new links to menuThank you so much!
Using that link I posted earlier, I’ve also stumbled my way into a solution with some editing! So I’ll post what I have here for anyone who might be looking for something similar!
1) Add the menu and it’s submenu normally through the dashboard (Appearance -> Menu). Name the parent menu with a placeholder name/identifier. In my case, #profile_name# (See screenshot) at http://imgur.com/a/Ffavj
2) Add the following code to your theme’s ‘function.php’
// Replace "My Profile" with user firstname + lastname function give_profile_name(){ $user=wp_get_current_user(); $name=$user->user_firstname; if (!empty($user->user_lastname)) { $name .= " " . substr($user->user_lastname, 0, 1) . "."; } if(empty($name)) { $name = "My Profile"; return $name; } else { return $name; } } add_shortcode('profile_name', 'give_profile_name'); add_filter( 'wp_nav_menu_objects', 'my_dynamic_menu_items' ); function my_dynamic_menu_items( $menu_items ) { foreach ( $menu_items as $menu_item ) { if ( '#profile_name#' == $menu_item->title ) { global $shortcode_tags; if ( isset( $shortcode_tags['profile_name'] ) ) { // Or do_shortcode(), if you must. $menu_item->title = call_user_func( $shortcode_tags['profile_name'] ); } } } return $menu_items; }This replaces the placeholder name/identifier with the logged-in user’s first name + first letter of his last name. If he does not have either a first name or last name saved, it will show as “My Profile” instead.
*The checking of whether a user is logged in or not here is handled by another plugin I have “User Menu”
Thank you so much once again sumithsuku11!
Forum: Fixing WordPress
In reply to: How do I add new links to menuThanks smithsuku11!
I found another post that seems to be similar to what I am trying to achieve so I’ll see if I can understand and use that.
Thanks again!
Forum: Fixing WordPress
In reply to: How do I add new links to menuThe menu on the top (Main navigation). Before logging in, it will show “Login” and “Register” but after logging in, it will show:
I would like to have the “My profile” to show the user’s first and last name.
Thanks!
- This reply was modified 8 years, 11 months ago by locomoco.
Forum: Fixing WordPress
In reply to: How do I add new links to menuOh sorry you meant the link to the website? It’s at
https://kyeoul.comForum: Fixing WordPress
In reply to: How do I add new links to menuHi, yes I think I got the menu with the dropdown list on hover, which I added via Appearance -> Menu. It looks like this (screenshot attached) at the moment (with the list of links upon hover of “My profile”. But instead of “My profile”, I’m hoping to have it show the logged-in user’s first and last name instead.
Sorry about breaking the forum rules!
- This reply was modified 8 years, 11 months ago by locomoco.
Forum: Fixing WordPress
In reply to: How do I add new links to menuYikes, that sounds complicated.. Does that mean I need 2 header.php or something? Sorry, my understanding of the inner workings of wordpress is severely limited :O
Forum: Fixing WordPress
In reply to: How do I add new links to menuWould you be able to point me in the direction of where I might be able to read up on making those dropdown menu list upon mouse hover? I am trying to have a link that shows the user’s profile name and when clicked, it brings them to their account page and when mouse hovered, it will show a menu with “edit profile” and “logout”
Thanks again!
Forum: Fixing WordPress
In reply to: How do I add new links to menuIt works perfect, thank you so much! 1 problem down, a few hundred more to go!^^
Forum: Fixing WordPress
In reply to: How do I add new links to menuYou are a lifesaver!
One more question, is it possible to make this be shown only to users who are not logged in?
Forum: Fixing WordPress
In reply to: How do I add new links to menuEdit: I added it into my theme’s function.php and it works! Thanks!
However, I’ve realised that the text style is different from the others (screenshots attached). How do I style the text?
Forum: Plugins
In reply to: [Ultimate FAQ Accordion Plugin] Styling the search barThanks, what about changing the words “Ask your question” or the space/line breaks between the search bar and the categories below?
1.3.84
May I know which files I should be looking into to edit that?
Forum: Themes and Templates
In reply to: [Edge] Transparency of top & search barThe quantity display/font size problem only shows in safari and works fine in chrome.
Forum: Themes and Templates
In reply to: [Edge] Transparency of top & search barIt can be see when you scroll down on the single product page here:
https://kyeoul.com/product/test-copy/
Also, the quantity number (beside the “Add to cart” button) is not aligned properly, is this something I can edit from the theme or is it some other plugin that is causing it?
Thanks again!
Forum: Themes and Templates
In reply to: [Edge Theme] How to change copyright in the footer?A bit late to this but you can just comment out the HTML part, like so:
<?php /************************* EDGE FOOTER DETAILS **************************************/ function edge_site_footer() { if ( is_active_sidebar( ‘edge_footer_options’ ) ) : dynamic_sidebar( ‘edge_footer_options’ ); else: echo ‘<div class=”copyright”>’ .’© ‘ . date(‘Y’) .’ ‘; ?> ” target=”_blank” href=”<?php echo esc_url( home_url( ‘/’ ) ); ?>”><?php echo get_bloginfo( ‘name’, ‘display’ ); ?><em><!--</em><strong> | <?php esc_html_e(‘Designed by:’,’edge’); ?> ” target=”_blank” href=”<?php echo esc_url( ‘http://themefreesia.com’ ); ?>”><?php esc_html_e(‘Theme Freesia’,’edge’);?> | <?php esc_html_e(‘Powered by:’,’edge’); ?> ” target=”_blank” href=”<?php echo esc_url( ‘http://wordpress.org’ );?>”><?php esc_html_e(‘WordPress’,’edge’); ?><em>--></em></strong> </div> <?php endif; } add_action( ‘edge_sitegenerator_footer’, ‘edge_site_footer’); ?>