开发者

Wordpress theme problems

开发者 https://www.devze.com 2022-12-13 23:51 出处:网络
I\'ve been making a wordpress theme recently and just now some of the code just stopped working. The post formatting disappeared and now I just have a paragraph with text inside it for eac开发者_如何学

I've been making a wordpress theme recently and just now some of the code just stopped working. The post formatting disappeared and now I just have a paragraph with text inside it for eac开发者_如何学运维h post! Here's the php code for the post:

<?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>

This is all the code in the index.php file in the theme folder. I have some metadata of the post on the left side of the post and the actual post on the right side.

This is what is outputs to the page. (This is only what is inside the #content div. There was too much for me to post everything.)

<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>

What happened!?


Do you mean that the only thing that gets processed is <?php the_excerpt(); ?>. Or is everything getting parsed, but you haven't posted the stuff generated by <?php the_time('F j, y') ?> between the other spans?

If the letter is the case, than it's simply a matter of using another template tag. the_excerpt only posts a small portion of a post, limited to a certain amount of characters. If you want to display the whole post, you'll need to use the_content.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号