• Resolved theultimatewebsiteblog

    (@theultimatewebsiteblog)


    I am wanting to know what code I need to display “read more…” on the first page (index.php)? I have searched Docs in WordPress.org, but I am still confused, so I am wondering if someone could please post the code here? Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Try editing the index.php template file in your theme and replace the_excerpt() with the_content(). Then edit each post and insert the <!– more tag –> where you want your posts’ excerpts/teasers to finish.

    read more tag is generally used for a particular post, not for the complete index page. If you want to control the length of your index page, you can limit the number of posts..

    You can add the read more tag in a particular post from wysisyg editor..

    Thread Starter theultimatewebsiteblog

    (@theultimatewebsiteblog)

    How come this isn’t working for me? I have gone into index.php (the template file) and replaced the_excerpt() with the_content(), then went into the post and inserted <!–more tag–> where I want the post to end.

    Maybe there is something wrong with my code, so I have decided to post my index.php code, here it is:
    <?php get_header(); ?>

    <?php include(TEMPLATEPATH . ‘/left.php’); ?>

    <?php include(TEMPLATEPATH . ‘/right.php’); ?>

    <div class=”mainContent”>

    <?php
    $postslist = get_posts(‘numberposts=10&order=ASC&orderby=title’);
    foreach ($postslist as $post) :
    setup_postdata($post);
    ?>

    <h1><?php the_title(); ?>, <small><?php the_date(); ?></small></h1>
    <?php the_content(); ?>

    <?php endforeach; ?>
    <!– end mainContent –></div><!– This clearing element should immediately follow the mainContent div in order to force the container div to contain all child floats –><br class=”clearfloat” />

    <?php get_footer(); ?>

    Thread Starter theultimatewebsiteblog

    (@theultimatewebsiteblog)

    Sorry I just got it to work.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘How do I display read more on index.php?’ is closed to new replies.