WordPress.org

Ready to get started?Download WordPress

Forums

Urgent: <!-- more --> does not work in WP page.... (1 post)

  1. mickeyckm
    Member
    Posted 8 years ago #

    Hi everyone,

    I'm having a little problem with the <!-- more -->. I just realised that the_content() only work properly in index.php and archive.php as in the <!-- more -->.

    What i did now is that, I used the index.php as a front page to display the summary of the latest posts in terms of title and date only and I've created another WP page called blog and asked it to use blog.php template file which contains exactly the same script to print out the post as in the index.php. However, somehow only index.php works but not the blog.php. Can anyone help? Your help is very much appreciated.

    Just asking, is it because of the Loop? Somehow only recognise index.php and archive.php. Thanks a million in advance.

    Best Regards,
    Mickey


    <div id="content">
    <h1>Blog</h1>

    <?php $my_query = new WP_Query('showposts=10');?>

    <?php if ($my_query->have_posts()) : ?>

    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>

    <div class="post" id="post-<?php the_ID(); ?>">
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>

    <div class="entry">
    <?php the_content('Read the rest of this entry &raquo;'); ?>
    </div>

    <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
    </div>

    <?php endwhile; ?>

    <div class="navigation">
    <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div>
    <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div>
    </div>

    <?php else : ?>

    <h2 class="center">Not Found</h2>
    <p class="center">Sorry, but you are looking for something that isn't here.</p>
    <?php include (TEMPLATEPATH . "/searchform.php"); ?>

    <?php endif; ?>
    </div>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags