【发布时间】:2011-03-02 16:25:49
【问题描述】:
我正在自定义一个 Wordpress 插件,但似乎无法弄清楚如何正确地将 <h1> 标签添加到它在我的帖子标题中引入的部分。我每次尝试都会遇到错误。
代码如下:
<?php query_posts('cat=3'); ?>
<?php
$category = get_option('wpns_category');
$n_slices = get_option('wpns_slices');
?>
<?php if( have_posts() ) : while( have_posts() ) : the_post(); ?>
<?php if ( has_post_thumbnail() ) {
echo '<a href="';
the_permalink();
echo '">';
the_post_thumbnail('slider-image', array( 'alt' =>
get_the_title(), 'title' => get_the_title() . "<br /><br /> <span>" . get_the_excerpt() .
"</span>"));
echo '</a>'; } ?>
<?php endwhile; ?>
<?php else : ?>
<h2>Not Found</h2>
<?php endif; ?>
我尝试过例如<h1>get_the_title(), 'title' =></h1>,但显然这是不正确的。有什么建议吗?
【问题讨论】: