WordPress.org

Forums

Display full posts in archives and categories (7 posts)

  1. where to willie
    Member
    Posted 2 years ago #

    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);
    		};
    	}
    }
  2. cassihl
    Member
    Posted 2 years ago #

    Depending on your theme, look in your archives.php page, you will probably find something like: <?php the_excerpt(); ?> change 'excerpt' to 'content'.

  3. where to willie
    Member
    Posted 2 years ago #

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

  4. cassihl
    Member
    Posted 2 years ago #

    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.

  5. alchymyth
    Forum Moderator
    Posted 2 years ago #

    what theme are you working with?

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

  6. where to willie
    Member
    Posted 2 years ago #

    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(); ?>
  7. cassihl
    Member
    Posted 2 years ago #

    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(); ?>.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.