Wordpress在滑块php上添加链接

时间:2016-10-28 11:17:35

标签: php wordpress slider

我有一个问题是添加到整个滑块的链接。 主题中的代码是这样的。我添加了一个href和esc_url($ this-&gt; _var(&#39; button_link&#39;))但是当滑块生成它时就像这个<a></a><div></div>一样,它应该像这个<a><div></div></a>

&#13;
&#13;
$output = sprintf(
			'<a href="%13$s"><div class="tm_pb_slide%6$s"%4$s%10$s%11$s>
				%8$s
				%12$s
				<div class="tm_pb_container clearfix">
					%5$s
					<div class="tm_pb_slide_description">
						%1$s
						<div class="tm_pb_slide_content%9$s">%2$s</div>
						%3$s
					</div> <!-- .tm_pb_slide_description -->
				</div> <!-- .tm_pb_container -->
				%7$s
			</div></a> <!-- .tm_pb_slide -->
			',
			$this->_var( 'heading' ),
			$this->shortcode_content,
			$this->_var( 'button' ),
			$this->_var( 'style' ),
			$this->_var( 'image' ),
			esc_attr( $class ),
			( '' !== $this->_var( 'background_video' ) ? $this->_var( 'background_video' ) : '' ),
			( '' !== $this->_var( 'background_image' ) && 'on' === $tm_pb_slider_parallax ? sprintf( '<div class="tm_parallax_bg%2$s" style="background-image: url(%1$s);"></div>', esc_attr( $this->_var( 'background_image' ) ),
			( 'off' === $tm_pb_slider_parallax_method ? ' tm_pb_parallax_css' : '' ) ) : '' ),
			( 'on' === $tm_pb_slider_hide_mobile['hide_content_on_mobile'] ? esc_attr( " {$hide_on_mobile_class}" ) : '' ),
			$data_dot_nav_custom_color,
			$data_arrows_custom_color,
			'on' === $this->_var( 'use_bg_overlay' ) ? '<div class="tm_pb_slide_overlay_container"></div>' : '',
			esc_url( $this->_var( 'button_link' ) )
		);
&#13;
&#13;
&#13;

前端代码

&#13;
&#13;
<p>
<a href="https://blog.modile.pl/2016/10/26/jaki-botki-sa-modne-jesienia-2016/"></a></p>
    <div class="tm_pb_slide tm_pb_bg_layout_light tm_pb_media_alignment_center tm_pb_slide_0 tm-pb-active-slide" style="background-color:#ffffff;background-image:url(https://blog.modile.pl/wp-content/uploads/2016/10/aksamitne-botki-fashion-week-fot-imaxtree.jpg);"><a href="https://blog.modile.pl/2016/10/26/jaki-botki-sa-modne-jesienia-2016/">
				
				
				</a><div class="tm_pb_container clearfix" style="min-height: 655px;"><a href="https://blog.modile.pl/2016/10/26/jaki-botki-sa-modne-jesienia-2016/">
					
					</a><div class="tm_pb_slide_description"><a href="https://blog.modile.pl/2016/10/26/jaki-botki-sa-modne-jesienia-2016/">
						</a><h2 class="tm_pb_slide_title"><a href="https://blog.modile.pl/2016/10/26/jaki-botki-sa-modne-jesienia-2016/"></a><a href="https://blog.modile.pl/2016/10/26/jaki-botki-sa-modne-jesienia-2016/">Jakie botki są modne jesienią 2016?</a></h2>
						<div class="tm_pb_slide_content">
<p style="text-align: left;">Na jesień 2016 projektanci przygotowali różnorodne botki. Sprawdź, czy wśród najmodniejszych fasonów, jest model dla ciebie.</p>
</div>
						<a href="https://blog.modile.pl/2016/10/26/jaki-botki-sa-modne-jesienia-2016/" class="tm_pb_more_button tm_pb_button">Czytaj więcej</a>
					</div> <!-- .tm_pb_slide_description -->
				</div> <!-- .tm_pb_container -->
				
			</div>
&#13;
&#13;
&#13;

0 个答案:

没有答案