• Resolved rdavis

    (@rdavis)


    How can I get an excerpt of a post to appear on the main page and, when clicked, lead to the full article in a category or archive off the main page? I have played with the the_content & the_excerpt tags, but I can only get one, the other, or worse a duplicated of the first 120 words to show up on any single page. Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • You can replace the_content in the index.php of your theme with the_excerpt, and put the_content in your single.php template.
    As for the archive view (=monthly, categories) you can use either of them, depending how do you want to be displayed.

    Thread Starter rdavis

    (@rdavis)

    Where in the single.php template? And thanks for the quick response.

    I think it would be in the “post-content” div.

    Thread Starter rdavis

    (@rdavis)

    Okay, I figured out how to do this in this theme:

    Like moshu so helpfuly said (thanks again!), replace the_content in the post.php file to get the excerpt to list on the main page. Open your single.php file (mine wasn’t listed under the “Edit Themes,” so I had to ftp it back and forth) and replace the line: <?php require(‘post.php’); ?>
    with the line: <?php the_content(); ?>
    And your done. The one bad thing about this was the bland beginning of your text, so I created a new class for the first letter in the post to be larger and colored, similar to how you seen in a magazine article. Good luck!

    rdavis, on a different note, can I ask how you did that drop captial for the first letter of the paragraph:

    https://www.down-view.com/?p=2

    I know its through css but how did you implement it. Did you edit it in the write post area, or did you set wordpress up to do it automatically (ie a plugin)??

    Thread Starter rdavis

    (@rdavis)

    Yeah, it’s edited in the wrote post area, not plugin. I just created a new class, rather than use then the first letter psuedo element rule. It’s pretty amatuer, but it works.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Excerpt on Main Page’ is closed to new replies.