Wordpress 如何隐藏索引页上的内容并在打开帖子时显示?

Wordpress 如何隐藏索引页上的内容并在打开帖子时显示?,wordpress,wordpress-theming,Wordpress,Wordpress Theming,我用WordPress 我的想法和你的一模一样。 我想在索引页上的内容不显示,但当操作后的内容将显示,如 使用_content(): 与_摘录()一起: 但是我希望内容不显示。我想你是说更多标签?它可用于截断主页和存档中的文本: 您必须创建两个页面1-index.php 2-single.php <?php if(have_posts()):?> <?php while(have_posts()): the_post();?> <?php the

我用WordPress

我的想法和你的一模一样。 我想在索引页上的内容不显示,但当操作后的内容将显示,如



使用_content():

与_摘录()一起:


但是我希望内容不显示。

我想你是说更多标签?它可用于截断主页和存档中的文本:

您必须创建两个页面1-index.php 2-single.php

<?php if(have_posts()):?> <?php while(have_posts()): the_post();?>
<?php the_title(); ?>
<?php endwhile; ?>
<?php endif; ?>
<?php if(have_posts()):?> <?php while(have_posts()): the_post();?>
<?php the_title(); ?>
<br>
<?php the_content();?>
<?php endwhile; ?>
<?php endif; ?>
index.php

<?php if(have_posts()):?> <?php while(have_posts()): the_post();?>
<?php the_title(); ?>
<?php endwhile; ?>
<?php endif; ?>
<?php if(have_posts()):?> <?php while(have_posts()): the_post();?>
<?php the_title(); ?>
<br>
<?php the_content();?>
<?php endwhile; ?>
<?php endif; ?>

single.php

<?php if(have_posts()):?> <?php while(have_posts()): the_post();?>
<?php the_title(); ?>
<?php endwhile; ?>
<?php endif; ?>
<?php if(have_posts()):?> <?php while(have_posts()): the_post();?>
<?php the_title(); ?>
<br>
<?php the_content();?>
<?php endwhile; ?>
<?php endif; ?>



在索引页上隐藏内容是什么意思?它的意思是:只显示标题吗?另外,您发布的代码是index.php还是single.php?是的,只在主页上显示标题。。。当点击任何显示标题和内容(如stackoverflow)的帖子时。。。