首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Wordpress主题问题

Wordpress主题问题
EN

Stack Overflow用户
提问于 2009-12-12 01:58:37
回答 1查看 119关注 0票数 0

我最近一直在做一个wordpress主题,刚才一些代码就停止工作了。帖子的格式消失了,现在我只有一个段落,里面有每个帖子的文本!下面是这篇文章的php代码:

代码语言:javascript
复制
<?php get_header(); ?>
    <div id="content">
        <div class="wrap">
            <div id="leftcol">
<?php if (have_posts()) : ?>

    <?php while (have_posts()) : the_post(); ?>
                <div class="post" id="post-<?php the_ID(); ?>">
                    <div class="meta alignleft">
                        <span class="date"><?php the_time('F j, y') ?></span>
                        <span class="comments"><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span>
                        <span class="tags"><?php the_tags('', ', ', ''); ?></span>
                    </div>
                    <div class="body alignright">
                        <h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
                        <?php the_excerpt(); ?>
                    </div>
                    <div class="clear"></div>
                </div>
    <?php endwhile; ?>

    <ul>
        <li><?php next_posts_link('&laquo; Older Entries') ?></li>
        <li><?php previous_posts_link('Newer Entries &raquo;') ?></li>
    </ul>

<?php else : ?>

    <h2>Not Found</h2>
    <p>Sorry, but you are looking for something that isn't here.</p>

<?php endif; ?>

            </div>
        </div>
    </div>

这是主题文件夹中index.php文件中的所有代码。我在帖子的左边有一些帖子的元数据,在右边有实际的帖子。

这就是输出到页面的内容。(这只是#content div中的内容。内容太多了,我不能把所有的东西都贴出来。)

代码语言:javascript
复制
<div id="content"><div class="wrap">
<div id="leftcol">
  <p>This is some random text that’s added just for effect. Thanks for the consideration. This is some random text that’s added just for effect. Thanks for the consideration. This is some random text that’s added just for effect. Thanks for the consideration. This is some random text that’s added just f<a href="#">or effect. Thanks for</a> the consideration. </p>
  <p>Welcome to WordPress. This is your first post. Edit or delete it, then start blogging! Welcome to WordPress. This is your first post. Edit or delete it, then start blogging! Welcome to WordPress</p>
</div></div></div>

怎么回事!?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2009-12-12 16:31:15

您的意思是说唯一需要处理的是<?php the_excerpt(); ?>。或者所有内容都被解析了,但是您还没有在其他spans之间发布由<?php the_time('F j, y') ?>生成的内容

如果字母是这样,那么只需使用另一个模板标记即可。the_excerpt只发布了一篇文章的一小部分,限于一定数量的字符。如果你想显示整个帖子,你需要使用the_content

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1889911

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档