WordPress.org

Support

Support » Themes and Templates » Display full posts in archives and categories

Display full posts in archives and categories

  • This looks to be where the code to excerpt the posts is happening, but I am not sure.

    [please mark any posted code – or better, use the pastebin – see http://codex.wordpress.org/Forum_Welcome#Posting_Code ]

    /*this function allows for the auto-creation of post excerpts*/
    if ( ! function_exists( 'truncate_post' ) ){
    	function truncate_post($amount,$echo=true,$post='') {
    		global $shortname;
    
    		if ( $post == '' ) global $post;
    
    		$postExcerpt = '';
    		$postExcerpt = $post->post_excerpt;
    
    		if (get_option($shortname.'_use_excerpt') == 'on' && $postExcerpt <> '') {
    			if ($echo) echo $postExcerpt;
    			else return $postExcerpt;
    		} else {
    			$truncate = $post->post_content;
    
    			$truncate = preg_replace('@\[caption[^\]]*?\].*?\[\/caption]@si', '', $truncate);
    
    			if ( strlen($truncate) <= $amount ) $echo_out = ''; else $echo_out = '...';
    			$truncate = apply_filters('the_content', $truncate);
    			$truncate = preg_replace('@<script[^>]*?>.*?</script>@si', '', $truncate);
    			$truncate = preg_replace('@<style[^>]*?>.*?</style>@si', '', $truncate);
    
    			$truncate = strip_tags($truncate); 
    
    			if ($echo_out == '...') $truncate = substr($truncate, 0, strrpos(substr($truncate, 0, $amount), ' '));
    			else $truncate = substr($truncate, 0, $amount);
    
    			if ($echo) echo $truncate,$echo_out;
    			else return ($truncate . $echo_out);
    		};
    	}
    }
Viewing 6 replies - 1 through 6 (of 6 total)
  • Depending on your theme, look in your archives.php page, you will probably find something like: <?php the_excerpt(); ?> change ‘excerpt’ to ‘content’.

    Doesn’t seem to me that I have an arichives.php page, that the theme has it customized in a bit more.

    Ok, how about in the index.php page. Try to find something like <?php is_archive(); ?> or is_post_type_archive( $post_type ) and edit the loop under that to say content instead of excerpt.

    Michael

    @alchymyth

    Forum Moderator

    what theme are you working with?

    check http://codex.wordpress.org/Template_Hierarchy to locate whis template is used.

    i’m running the Chameleon theme. I do have an index.php, but it looks like this:

    <?php get_header(); ?>
    
    <?php get_template_part('includes/breadcrumbs'); ?>
    
    <?php get_template_part('/includes/top_info'); ?>
    
    <div id="content" class="clearfix">
    	<div id="left-area">
    		<?php get_template_part('includes/entry'); ?>
    	</div> 	<!-- end #left-area -->
    
    	<?php get_sidebar(); ?>
    </div> <!-- end #content -->
    
    <?php get_footer(); ?>

    You need to find the file where the code is that is in ‘includes/entry’. Eventually you will find the “loop” where it says <?php the_excerpt(); ?>.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Display full posts in archives and categories’ is closed to new replies.
Skip to toolbar