我使用此代碼在我的主頁上顯示帖子。 <?php the_title(); ?>
正在返回空白。我對wordpress和php相當陌生。謝謝。Wordpress the_title();顯示空白
來源:idolizeonline.com(NSFW鏈接)(不起作用爲宜)
- 如果你將鼠標懸停在縮略圖的文章的標題和摘要應apear在圖像上。 (摘錄標題不)
<?php if(!of_get_option('ttrust_open_project_single')) : ?>
<div class="project small ajx <?php echo $p; ?>" id="project-<?php echo $post->post_name;?>">
<a href="<?php the_permalink() ?>" rel="bookmark" ></a>
<a href="#<?php echo $post->post_name; ?>" ><?php the_post_thumbnail($project_thumb_size, array('class' => 'thumb', 'alt' => ''.get_the_title().'', 'title' => ''.get_the_title().'')); ?></a>
<span class="title">
<div>
<span id="theTitle"><?php the_title(); ?></span>
<span id="theExcerpt"><?php the_excerpt(); ?></span>
</div>
</span>
</div>
<?php else: ?>
<div class="project small <?php echo $p; ?>" id="project-<?php echo $post->post_name;?>">
<a href="<?php the_permalink() ?>" rel="bookmark" ></a>
<a href="<?php the_permalink() ?>" ><?php the_post_thumbnail($project_thumb_size, array('class' => 'thumb', 'alt' => ''.get_the_title().'', 'title' => ''.get_the_title().'')); ?></a>
<span class="title">
<div>
<span id="theTitle"><?php the_title(); ?></span>
<span id="theExcerpt"><?php the_excerpt() ?></span>
</div>
</span>
</div>
<?php endif; ?>
對'the_exerpt()'的調用是否有效? – andrewsi
@andrewsi,它是'the_excerpt()'。 –
@SpencerCameron - 這是我咖啡因不足時發生的情況。雖然我仍然想知道它是否有效:) – andrewsi