嗨我想修改一個obox滑塊以包含target="_blank"
的HTML。這裏是我正在處理的代碼,但我太初學PHP了。應該很容易知道語法的人..需要修改WP小部件使用目標= _blank
// $string1=" target=_blank; // I added this but don't think I need it...
$link = get_post_meta($post->ID, 'slider_link', true);
//if ($link != "") want to check if there is a url and if so add target=blank
//<a href="<?php echo $link // don't know how to do this...
//$link=$link.$string1; // I added this line as well
if($link == "")
$link = get_permalink($post->ID); ?>
<li>
<?php if($image !="") : ?>
<div class="fitvid">
<a href="<?php echo $link; ?>">
<?php echo $image; ?>
</a>
</div>
<?php endif; ?>
感謝您的任何幫助!
你只是想在'class =「fitvid」'DIV下的鏈接中添加'target =「_ blank」'? – slapyo 2014-10-28 16:43:37
是的,應該這樣做,我認爲。那麼準確的代碼是什麼? – precords 2014-10-28 16:53:34
不明白。 ' vaso123 2014-10-28 16:56:31