Say I have MyAccount and MyStats in navigation and I want to wrap a tag around the ‘My’ text. How would I do this in WordPress?
e.g MyHouse, MyStreet.
Say I have MyAccount and MyStats in navigation and I want to wrap a tag around the ‘My’ text. How would I do this in WordPress?
e.g MyHouse, MyStreet.
You must be logged in to post a comment.
If I’m understanding the question correctly, you just want to make the word “My” bold? Take a look at this screen shot, you should be able to post it right into the Nav menu, depending on exactly what you want to add:
If you are using jQuery you could do something like this in order to wrap the first two letters of each menu item with a
<span>
element.You may need to change the selector, or be more specific in order that you don’t effect all the
li
‘s on your site.Here is a working fiddle – http://jsfiddle.net/dM5sb/
For a PHP solution if you are currently using
wp_nav_menu()
you might want to switch over toget_pages()
and do something like this.This is untested, but you can read more about the wordpress
get_pages()
function here – http://codex.wordpress.org/Function_Reference/get_pagesYou need to do this by editing your head.php/header.php file most likely. To do this you will need to do one of two things. Either FTP into your server and navigate to
and find either nav or menu. Alternatively in the back end of wordpress, go to
find the file here and make the necessary changes.
With this method you will need to hardcode the menu item in. Therefore any changes to page name etc will not be represented. But this is the easiest method to do this.
If you want custom navigation names you could simply make a custom menu:
This link helped me alot to get what I wanted:
How do I generate a custom menu/sub-menu system using wp_get_nav_menu_items in wordpress?
I would put my code in here if getting the code to validate was such a problem.
Thanks for your answers