• I love this plugin, but am a little annoyed that it inserts a
    body { font-weight: bold; color: red; } style into the footer!

    Please place the styles in the head, where I can easily overwrite them with my CSS, or at the very least, remove the above line so I don’t have to manually edit the plugin each time I upgrade to a new version.

    Thanks 🙂

Viewing 1 replies (of 1 total)
  • Thread Starter thirdboxcar

    (@thirdboxcar)

    On that note (sorry for the duplicate posts), I’d also love the 23px padding-left and the background-position styles removed.

    I modified your plugin to only enter CSS styles for those menus WITH images (instead of every menu, regardless of whether they had an image associated, which is needless mark-up). I’m not expert enough to figure out how to insert the CSS into the head as opposed to the footer, but that would really be my ideal!

    function get_custom_menu_image_css($menuItems, $args){
    		//print_r($menuItems);
    		$this->styles[] = '<style>';
    		$custom_options = (get_option($this->prefix));
    		foreach ($menuItems as $key => $val ) {
    			$menuItems[$key]->classes = array('menu_item_'.$val->ID);
    			$image_url = ($custom_options[$val->ID]['url_type'] != 'lib' ? $custom_options[$val->ID]['url'] : $custom_options[$val->ID]['media_lib']);
    			if($image_url != '') {
    			$this->styles[] = '
    				li.menu-item.menu_item_'.$val->ID.' {
    					background-image: url('.$image_url.');
    				}
    			';	}
    		}
    		$this->styles[] = '</style>';
    		return $menuItems;
    	}
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Custom menu images] Please remove bold and red styles from body CSS’ is closed to new replies.