簡體   English   中英

Wordpress-主菜單導航的圖像href不起作用

[英]Wordpress - Image href for home menu nav not working

我有一個image linked to a li element navbar in wordpress image linked to a li element

一切正常,但是當我將鼠標懸停在圖像上時,它也在列表中顯示一個菜單元素懸停。

當鏈接到圖像時,如何隱藏呢?

這是為此的php代碼(來自nav-menu-template.php):

if( $args->theme_location == 'primary' )
    return "<li id='menu-item-1000' class='menu-item menu-item-type-post_type menu-item-object-page menu-item-1000'><a class='logo' href='http://razvanwork.esy.es/exelo'><img style='position:absolute;top:-20px;left:-125px;z-index:200;max-width: 402%; ' src='http://razvanwork.esy.es/exelo/wp-content/uploads/2014/02/LogoPrelucrat.png' alt='Exelo' ></a></li>".$items;

我附上一張圖片以顯示其功能: 在此處輸入圖片說明

提前致謝

我自己一個人做到了,這很簡單。 我在href上放了一些文本,因此它與導航欄菜單保持一致。 之后,我將a href的相對位置放到左側,然后將其浮動到左邊,因此我可以將圖像放置在絕對位置的頂部。

這是代碼:

$args->theme_location == 'primary' )
    return "<li id='custom-menu-item' class='logo-menu-item'><a style='position:relative;left:-68px' class='logo' href='http://razvanwork.esy.es/exelo'>a<img style='position:absolute;top:-22px;left:-81px;z-index:200;max-width: 402%;' src='http://razvanwork.esy.es/exelo/wp-content/uploads/2014/02/LogoPrelucrat.png' alt='Exelo' ></a></li>".$items;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM