![](/img/trans.png)
[英]How do i reference another page in <a href=“”> in wordpress theme
[英]How do I add a href to an image in php on wordpress linking to another page?
我對編碼非常陌生,這是我在這里的第一篇文章,我一生都無法弄清楚。 我什至有一個編碼嘗試的朋友,但他也被卡住了。 圖像使用懸停webkit轉換,將圖像懸停在圖像上時會變大一點。 它在CSS中執行此操作:
.circle img {
position:relative;
display:block;
width:200px;
height:200px;
-webkit-border-radius: 100px;
border-radius: 100px;
overflow:hidden;
margin:0px auto 20px;
-webkit-transform: scale(1,1);
-webkit-transition-timing-function: ease-out;
-webkit-transition-duration: 250ms;
-moz-transform: scale(1,1);
-moz-transition-timing-function: ease-out;
-moz-transition-duration: 250ms;
}
circle:hover img {
-webkit-transform: scale(1.05,1.07);
-webkit-transition-timing-function: ease-out;
-webkit-transition-duration: 250ms;
-moz-transform: scale(1.05,1.07);
-moz-transition-timing-function:
}
PHP:
<div class="container">
<div class="sixteen columns">
<div class="five columns fma alpha">
<div class="fma-content">
<div class="circle">
<?php echo(types_render_field("home-fma-1-image", array())); ?>
</div>
<h3><?php echo(types_render_field("home-fma-1-headline", array())); ?></h3>
<p><?php echo(types_render_field("home-fma-1-copy", array())); ?></p>
</div>
</div>
</div>
</div>
該圖像是我認為的“ home-fma-1-image”。
編輯:我嘗試過此:
<div class="circle">
<a href="whatever page"><?php echo(types_render_field("home-fma-1-image", array())); ?></a>
</div>
它使整個事物成為一個鏈接,圖像,下面的文本以及下面的其他文本。 這是一個問題,因為我的主題使鏈接文本變為黃色,並且所有大寫字母對於段落來說看起來都很奇怪。
基於上下文,我假設這是主題中內置的圖像? 如果是這樣,應該就像在php代碼周圍添加一個標簽並使用href屬性一樣簡單。 見下文:
<div class="circle">
<a href="whatever page"><?php echo(types_render_field("home-fma-1-image", array())); ?></a>
</div>
另外,如果執行此操作,請更改css以合並標簽。 .circle a img
,而不是.circle img
如果您正在尋找其他東西,請告訴我。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.