Wordpress Menu Code Help Plz
- Started
- Last post
- 6 Responses
- sem
Hi,
Are there any code folk out there who have a spare min to help me a sec.
I found this http://wordpress.org/support/top… which let me show my 'Tile Attributes' in my menu, but its turned part of the text italic, how can I make it normal?
AND, if possible...could I change the color of the attributes? just them alone.
Thanks in advance :)
- GeorgesII0
cancel the <em>
-
good action of the day
✓ Done- you legend, thank you.sem
- Best QBN self-pat-on-the-back I've seen today.orrinward2
- ETM0
If you want to change the color, replace the spots where the <em> tag pair was with:
<span class=[class name]>{$item->attr_title}</span> or if you're using external css, or you can do inline with:
<span style="color:# [insert hex value]">{$item->attr_title}</span>
- sem0
I just put
/*************************** Register the nav menu in the header */
register_nav_menus( array(
'primary-menu' => __( 'Header Navigation', 'primary-menu' ),
'footer-menu' => __( 'Footer Menu', 'footer-menu' ),
) );add_filter('walker_nav_menu_star... 'description_in_nav_el', 10, 4);
function description_in_nav_el($item_outp... $item, $depth, $args)
{
return preg_replace('/(<a.*?>[^<]*?)</', '$1' . "<span style="color:# [999999]">{$item->attr_title}</span><", $item_output);
}In the functions.php an it crashed my site? ha. Had to replace the php via FTP to fix it...any ideas?
- sem0
Anyone? please?
- aaux0
Drop the brackets from your [999999]. Should just be:
color: #999999
Although I personally would change it to just adding a class so that you can control it via the stylesheet rather than hardcoded into the HTML being generated.