WordPress.org

Ready to get started?Download WordPress

Forums

Change Full Posts to Excerpts (3 posts)

  1. tachb
    Member
    Posted 1 year ago #

    I am trying to change my posts so it will show excerpts instead of full posts. I found this code in loop single.php

    <div class="entry">
    					<?php the_post_thumbnail('thumbnail', array('class' => 'alignleft')); ?>
    	                                <?php the_content(__('» Read more..', 'themezee_lang')); ?>
    					<div class="clear"></div>
    					<?php wp_link_pages(); ?>
    				</div>

    [Please post code or markup snippets between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

    I changed the <?php the_content(__('» Read more..', 'themezee_lang')); ?> to <?php the_excerpt(); ?> and it showed excerpts but when I clicked on the actual article only the excerpt showed, not the whole article. C

    Can anyone please help?e

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    possible more likely in loop.php, or to what template part index.php might point.

    (most files with 'single' in the name are for single post views)

  3. Bazan
    Member
    Posted 1 year ago #

    single.php is a template for a 1 direct post in full size. It means - no the list of posts. So single.php has to have a content.

    Change the_content() for the_excerpt() in index.php and archive.php etc.

    Any archives files (list of posts - category's posts, author's posts) should change content to excerpt.

    Files which WP use to show archives are:

    category.php, author.php, archive.php, tags.php(? not sure), custom-name.php,

    Then if theme dont have these files for specified type of archive - it use index.php

    MORE: http://codex.wordpress.org/File:Template_Hierarchy.png

    WARNING!
    IF you use as a homepage a static page not a blog page.

    Then a standard blog page using home.php - there u can change a standard post list.

Topic Closed

This topic has been closed to new replies.

About this Topic