loper主题首页幻灯片在新窗口打开和增加图片链接,王桂明在使用loper主题首页幻灯片时发现如图:

loper主题首页幻灯片在新窗口打开和增加图片链接

loper主题首页幻灯片在新窗口打开和增加图片链接

这2 处打开就直接到链接页,而不是在新窗口打开,如果我们放不是本博广告,就会跳出本博,如果我们调置新窗口打开就解决了这个问题。

另外王桂明还发现,首页幻灯片图片没有链接到网页,只是单纯的一个图片,如图:

loper主题首页幻灯片在新窗口打开和增加图片链接

loper主题首页幻灯片在新窗口打开和增加图片链接

我们也为图片加上网页链接,并在新窗口打开,方法是在后台打开外观--编辑---slideshow.php,如图:

loper主题首页幻灯片在新窗口打开和增加图片链接

loper主题首页幻灯片在新窗口打开和增加图片链接

为里面的代码加上

target="_blank"

要改的地方很多,包括每个图片增加网页链接并在新窗口打开,所以直接把整个slideshow.php放到下面:

<script type="text/javascript" src="<?php bloginfo('template_url');?>/scripts/jquery.cycle.min.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		var $js=jQuery.noConflict();
		    $js('.loperslideshow').cycle({ 
			fx:    'fade', 
			prev:   '.slideprev',
			next:   '.slidenext',
			delay: 2000,
			timeout: 6000
 
			});
 
	});
</script>		
<div class="slideshowbg">
<a class="slideprev" href="#">Prev</a> <a class="slidenext" href="#">Next</a>
	<div class="loperslideshow">
		<?php $options = get_option('loper_options'); ?>
		<?php if($options['slideshow1']): ?> 
            <div>
				<div class="slidefade">
					<div class="slideimg"> <a href="<?php echo($options['slideshow1_link']); ?>" target="_blank"><img src="<?php echo($options['slideshow1_img']); ?>" width="190" height="80"></a>
			    </div>
					<div class="slidecontent">
						<h3><a href="<?php echo($options['slideshow1_link']); ?>" target="_blank" title="<?php echo($options['slideshow1_title']); ?>"><?php echo($options['slideshow1_title']); ?></a></h3>
						<section class="slidetext">
						<?php echo($options['slideshow1_text']); ?>
						</section>	
 
						<a class="slidelink" href="<?php echo($options['slideshow1_link']); ?>"  target="_blank" title="<?php echo($options['slideshow1_title']); ?>"  rel="nofollow">more</a>
					</div>
				</div>
 
            </div>
		<?php endif; ?>	
 
				<?php if($options['slideshow2']): ?> 
            <div>
				<div class="slidefade">
					<div class="slideimg"> <a href="<?php echo($options['slideshow2_link']); ?>" target="_blank"><img src="<?php echo($options['slideshow2_img']); ?>" width="190" height="80"></a>
          </div>
					<div class="slidecontent">
						<h3><a href="<?php echo($options['slideshow2_link']); ?>"  target="_blank" title="<?php echo($options['slideshow2_title']); ?>"><?php echo($options['slideshow2_title']); ?></a></h3>
						<section class="slidetext">
						<?php echo($options['slideshow2_text']); ?>
						</section>	
 
						<a class="slidelink" href="<?php echo($options['slideshow2_link']); ?>"  target="_blank" title="<?php echo($options['slideshow2_title']); ?>"  rel="nofollow">more</a>
 
					</div>
				</div>
 
            </div>
		<?php endif; ?>	
 
 
		<?php if($options['slideshow3']): ?> 
            <div>
				<div class="slidefade">
					<div class="slideimg"> <a href="<?php echo($options['slideshow3_link']); ?>" target="_blank"><img src="<?php echo($options['slideshow3_img']); ?>" width="190" height="80"></a>
			    </div>
					<div class="slidecontent">
						<h3><a href="<?php echo($options['slideshow3_link']); ?>"  target="_blank" title="<?php echo($options['slideshow3_title']); ?>"><?php echo($options['slideshow3_title']); ?></a></h3>
						<section class="slidetext">
						<?php echo($options['slideshow3_text']); ?>
						</section>	
 
						<a class="slidelink" href="<?php echo($options['slideshow3_link']); ?>"  target="_blank" title="<?php echo($options['slideshow3_title']); ?>"  rel="nofollow">more</a>
 
					</div>
				</div>
            </div>
		<?php endif; ?>	
 
		<?php if($options['slideshow4']): ?> 
            <div>
				<div class="slidefade">
					<div class="slideimg"> <a href="<?php echo($options['slideshow4_link']); ?>" target="_blank"><img src="<?php echo($options['slideshow4_img']); ?>" width="190" height="80"></a>
			    </div>
					<div class="slidecontent">
						<h3><a href="<?php echo($options['slideshow4_link']); ?>"  target="_blank" title="<?php echo($options['slideshow4_title']); ?>"><?php echo($options['slideshow4_title']); ?></a></h3>
						<section class="slidetext">
						<?php echo($options['slideshow4_text']); ?>
						</section>	
 
						<a class="slidelink" href="<?php echo($options['slideshow4_link']); ?>"  target="_blank" title="<?php echo($options['slideshow4_title']); ?>"  rel="nofollow">more</a>
 
					</div>
				</div>
            </div>
		<?php endif; ?>	
 
		<?php if($options['slideshow5']): ?> 
            <div>
				<div class="slidefade">
					<div class="slideimg"> <a href="<?php echo($options['slideshow5_link']); ?>" target="_blank"><img src="<?php echo($options['slideshow5_img']); ?>" width="190" height="80"></a>
			    </div>
					<div class="slidecontent">
						<h3><a href="<?php echo($options['slideshow5_link']); ?>"  target="_blank" title="<?php echo($options['slideshow5_title']); ?>"><?php echo($options['slideshow5_title']); ?></a></h3>
						<section class="slidetext">
						<?php echo($options['slideshow5_text']); ?>
						</section>	
 
						<a class="slidelink" href="<?php echo($options['slideshow5_link']); ?>"  target="_blank" title="<?php echo($options['slideshow5_title']); ?>"  rel="nofollow">more</a>
					</div>
				</div>
            </div>
		<?php endif; ?>	
 
		<?php if($options['slideshow6']): ?> 
            <div>
			<div class="slidefade">
					<div class="slideimg"> <a href="<?php echo($options['slideshow6_link']); ?>" target="_blank"><img src="<?php echo($options['slideshow6_img']); ?>" width="190" height="80"></a>
	    </div>
					<div class="slidecontent">
						<h3><a href="<?php echo($options['slideshow6_link']); ?>" title="<?php echo($options['slideshow6_title']); ?>"><?php echo($options['slideshow6_title']); ?></a></h3>
						<section class="slidetext">
						<?php echo($options['slideshow6_text']); ?>
						</section>	
 
						<a class="slidelink" href="<?php echo($options['slideshow6_link']); ?>" title="<?php echo($options['slideshow6_title']); ?>"  rel="nofollow">more</a>
 
					</div>
				</div>
			</div>
		<?php endif; ?>	
	</div>
</div>
 
 <div class="slidebottom"></div>

复制更换slideshow.php里面代码就OK了,然后看本博的实际效果

» 订阅本站: http://www.0523jz.com/feed