我使用的是Fusion优雅主题,但我对特色滑块有问题。
我为幻灯片添加了自定义的“阅读更多”链接。但是,在指定了特色图片的地方,单击该图片不会链接到我指定的自定义链接,而只是导航到特色帖子。
我已经在下面发布了我认为相关的代码。
非常感谢您的帮助!
et_get_option(\'fusion_feat_pages\') ),
\'posts_per_page\' => (int) $featured_num
)
)
);
}
while ( $featured_query->have_posts() ) : $featured_query->the_post();
$post_id = get_the_ID();
$bg = et_get_option( \'fusion_bg_image\' );
if ( \'\' == $bg ) $bg = get_template_directory_uri() . \'/images/bg_fusion.jpg\';
$slide_bg = ( $slide_bg_url = get_post_meta( $post_id, \'_et_slide_bg\', true ) ) && \'\' != $slide_bg_url ? $slide_bg_url : $bg;
$slide_subtitle = get_post_meta( $post_id, \'_et_slide_subtitle\', true );
$slide_more_text = get_post_meta( $post_id, \'_et_slide_more_text\', true );
$slide_more_link = get_post_meta( $post_id, \'_et_slide_more_link\', true );
$more_link = \'\' != $slide_more_link ? $slide_more_link : get_permalink();
?>
<div class="et-slide"<?php if ( \'\' != $slide_bg ) echo \' style="background-image: url(\' . esc_url( $slide_bg ) . \');"\'; ?>>
<div class="container clearfix">
<div class="description">
<h2><a href="<?php echo esc_url( $more_link ); ?>"><?php the_title(); ?></a></h2>
<?php if ( \'\' != $slide_subtitle ) { ?>
<p class="subtitle"><?php echo esc_html( $slide_subtitle ); ?></p>
<?php } ?>
<p><?php truncate_post( 180 ); ?></p>
<a href="<?php echo esc_url( $more_link ); ?>" class="more">
<?php if ( \'\' != $slide_more_text ) echo esc_html( $slide_more_text ); else esc_html_e( \'Read More\', \'Fusion\' ); ?>
</a>
</div> <!-- .description -->
<?php
$width = (int) apply_filters( \'slider_image_width\', 535 );
$height = (int) apply_filters( \'slider_image_height\', 572 );
$title = get_the_title();
$thumbnail = get_thumbnail( $width, $height, \'\', $title, $title, false, \'Featured\' );
$thumb = $thumbnail["thumb"];
?>
<div class="featured-image">
<a href="<?php the_permalink(); ?>"><?php print_thumbnail( $thumb, $thumbnail["use_timthumb"], $title, $width, $height, \'\' ); ?></a>
</div> <!-- .featured-image -->
</div> <!-- .container -->