WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Want to show Post Titles Only (5 posts)

  1. ramrod1
    Member
    Posted 1 year ago #

    I would like my main posts page to show post titles only....no content. When I click on a category it goes to the posts in that category and shows content...that's great. I just don't want any post content showing on the main blog page...just titles. Can this be done? Thanks

  2. Connor Crosby
    Member
    Posted 1 year ago #

    Yep! This will be very easy as long as the main blog page and the category don't reference the same file.

    Simply navigate to your theme files and go to index.php (or possibly home.php). Then find where it says <?php the_content(); ?> and simply comment it out like so: <?php /* the_content(); */ ?>. That should do the trick.

  3. ramrod1
    Member
    Posted 1 year ago #

    BEAUTIFUL! You da man Conner..that was so clean and easy. I'm slowly learning that little code strategies like this are so much more elegant than plugins. Thank you a ton.

  4. Connor Crosby
    Member
    Posted 1 year ago #

    You're welcome! In case you did not know, that basically made that a PHP comment. The code is still there, but WordPress skips over it. So, if you ever want to add that back, simply remove the comments /* and */

  5. ramrod1
    Member
    Posted 1 year ago #

    Yeah...the php comments are very cool. I've deleted a few things earlier in my building adventure and had to go to the theme folder on my hard drive to upload the original files and sort of "reset" LOL!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.