• I have started to make my own wordpress theme. I have just started running to trouble with the excerpt.

    I have replaced

    <?php the_content(‘Read more…’); ?>
    with
    <?php the_excerpt(); ?>

    Now when i used read more everything worked fine, but I want to write a separate excerpt, to kind of promote each story. When i used the excerpt, it showed up fine, but when i clicked the title to see the rest of the story, it would go to

    https://localhost:8888/wordpress/?p=6

    but only the excerpt would be there, with a weird space now between the content and the footer, where the rest of the content should go but its just blank
    Any Help would be Much Appreciated

Viewing 4 replies - 1 through 4 (of 4 total)
  • Do you have a single.php file in your theme directory? If you don’t, I believe that WP falls back on index.php for everything.

    Thread Starter anderskitson

    (@anderskitson)

    That makes sense as to why this would be happening. What would the single.php file consist of code wise. Or would it be the same just with content there instead of the excerpt. Im assuming it will just apply the code from single.php to each blog post for P=6, p=5 and so on. Thanks for the reply.

    I would look at other themes first to get an idea of how to setup single.php. There are a few ways I have done this. The first way is using single.php and the other way is using if/else statements. For example: If is homepage, display 6 posts as excerpts else display the full content and meta data.

    To me…single.php is the better way.

    The cheap and dirty way of just getting something done, try duplicating index.php, rename it to single.php, remove the excerpting, and give it a shot. WordPress knows single.php is to display a single post. There is some magic happening in the background, but I sure don’t know what it is ??

    Thread Starter anderskitson

    (@anderskitson)

    Awesome Just renamed my index to single and add the excerpt. Seems to work fine. Maybe more code than neccessary, but thats ok.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Issue with the Excerpt’ is closed to new replies.