Support » Fixing WordPress » Show Full Posts on main page?

  • Resolved rkell

    (@rkell)


    Hi all,

    Pretty new to wordpress and using the modularity theme, however only my most recent post is shown in full, and my earlier posts (and their images) are annoyingly cut.

    I have found a fair bit of info on the net about changing content/excerpt entries, however can’t find any such entries when using the editor.

    Is there some way I can make all posts display in full unless I decide to split it into an excerpt? (There doesn’t appear to be an easy way to do this??)

    Even if i can find a way to make

      all

    posts display in full that would be great – as generally my posts won’t be super-long.

    Thanks in advance!

    Rey

Viewing 15 replies - 1 through 15 (of 15 total)
  • Can’t see what you posted as you need to backtick code for it to display correctly in the forums.

    The code content/excerpt you need to change isn’t in the post/page editor; it’s in the theme files. See Template Tags/the content « WordPress Codex and Template Tags/the excerpt « WordPress Codex

    Thread Starter rkell

    (@rkell)

    songdogtech – thanks for your reply – I hadn’t actually posted any code.

    The ‘editor’ I referred to is in fact the theme file editor – I cannot seem to find any reference to where a the_excerpt tag can be changed to the_content.

    Come to think of it… there doesn’t even seem to be any evidence at all of post options in ‘the loop’ on my main index template;

    <?php get_header(); ?>
    
    <!-- Show the welcome box and slideshow only on first page.  Makes for better pagination. -->
    <?php if ( $paged < 1 ) { ?>
    
    <!-- Begin Welcome Box -->
    <?php if (is_home()) include (THEMELIB . '/apps/welcomebox.php'); ?>
    
    <!-- Begin Slideshow -->
    <?php include (THEMELIB . '/apps/slideshow-static.php'); ?>
    
    <!-- End Better Pagination -->
    <?php } ?>
    
    <!-- Begin Blog -->
    <?php include (THEMELIB . '/apps/blog.php'); ?>
    
    <!-- Begin Footer -->
    <?php get_footer(); ?>

    Any suggestions??

    You need to head over to the /apps/blog.php. That’s where you’ll find ‘The Loop’ and what you need to edit.

    Depends on the theme; it may be in blog.php or in functions.php, if your theme uses a functions file.

    True.

    Thread Starter rkell

    (@rkell)

    Thanks for the responses so far guys.
    I don’t want to sound like a total fool, but the theme files listed are as follows and I can’t find reference to the loop in functions or index…or anywhere else for that matter (am i missing something??);

    Theme Files
    Templates

    * 404 Template (404.php)
    * Archives (archive.php)
    * Comments (comments.php)
    * Footer (footer.php)
    * Header (header.php)
    * Image Attachment Template (image.php)
    * Main Index Template (index.php)
    * Page Template (page.php)
    * Search Form (searchform.php)
    * Search Results (search.php)
    * Sidebar (sidebar.php)
    * Single Post (single.php)
    * Theme Functions (functions.php)
    * Wide Page Page Template (page-wide.php)
    * nav.php (nav.php)

    Styles

    * Stylesheet (style.css)

    Is there a directory in your theme folder called /apps/, and beneath it a file called blog.php?

    The Loop looks something like this, depending on your theme:

    <?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?>
    
    <div class="post" id="post-<?php the_ID(); ?>"><h4>
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h4><p class="details">
    <?php the_time('F jS, Y') ?></p>
    
    <?php the_content(); ?>
    
    </div>
    <?php endwhile; ?>
    <?php else : ?>
    
    <h4>Sorry, but you are looking for something that isn't here.</h4>
    
    <?php endif; ?>

    See <?php the_content(); ?> in that code? You will have <?php the_excerpt(); ?> in that spot instead of the_content in page.php or single.php or page-wide.php, whatever that is. Unless those pages point to blog.php. What theme are you using?

    Thread Starter rkell

    (@rkell)

    keighl – I don’t seem to have a directory called apps. The only directories in my theme folder are images, js and library.

    songdogtech – I’m using Modularity lite.
    In page.php, single.php and page-wide.php i have the following (already has the_content, and not the_excerpt)

    page.php:

    <?php get_header(); ?>
    <div class="span-<?php
    		$sidebar_state = get_option('T_sidebar_state');
    
    		if($sidebar_state == "On") {
    			echo "15 colborder home";
    		}
    		else {
    			echo "24 last";
    		}
    		?>">
    <div class="content">
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    			<h2><?php the_title(); ?></h2>
    			<?php include (THEMELIB . '/apps/multimedia.php'); ?>
    			<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
    			<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    		</div>
    		<?php endwhile; endif; ?>
    	<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
    	</div>
    	</div>
    	<?php
    		$sidebar_state = get_option('T_sidebar_state');
    
    		if($sidebar_state == "On") {
    			get_sidebar() ;
    		}
    		else {
    			echo "";
    		}
    		?>
    
    <!-- Begin Footer -->
    <?php get_footer(); ?>

    single.php:

    <?php get_header(); ?>
    <div class="span-<?php
    		$sidebar_state = get_option('T_sidebar_state');
    
    		if($sidebar_state == "On") {
    			echo "15 colborder home";
    		}
    		else {
    			echo "24 last";
    		}
    		?>">
    <div class="content">
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <h2><?php the_title(); ?></h2>
    <?php include (THEMELIB . '/apps/multimedia.php'); ?>
    <?php the_content(); ?>
    </div>
    <div class="clear"></div>
    
    <p class="postmetadata alt">
    					<small>
    						This entry was posted
    						<?php /* This is commented, because it requires a little adjusting sometimes.
    							You'll need to download this plugin, and follow the instructions:
    							http://binarybonsai.com/archives/2004/08/17/time-since-plugin/ */
    							/* $entry_datetime = abs(strtotime($post->post_date) - (60*120)); echo time_since($entry_datetime); echo ' ago'; */ ?>
    						on <?php the_time('l, F jS, Y') ?> at <?php the_time() ?>
    						and is filed under <?php the_category(', ') ?><?php if (get_the_tags()) the_tags(' and tagged with '); ?>.
    							You can follow any responses to this entry through the <?php post_comments_feed_link('RSS 2.0'); ?> feed.
    
    						<?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
    							// Both Comments and Pings are open ?>
    							You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(); ?>" rel="trackback">trackback</a> from your own site.
    
    						<?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
    							// Only Pings are Open ?>
    							Responses are currently closed, but you can <a href="<?php trackback_url(); ?> " rel="trackback">trackback</a> from your own site.
    
    						<?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
    							// Comments are open, Pings are not ?>
    							You can skip to the end and leave a response. Pinging is currently not allowed.
    
    						<?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
    							// Neither Comments, nor Pings are open ?>
    							Both comments and pings are currently closed.
    
    						<?php } edit_post_link('Edit this entry','','.'); ?>
    
    					</small>
    				</p>
    
    <div class="nav prev left"><?php next_post_link('%link', '&larr;', TRUE); ?></div>
    <div class="nav next right"><?php previous_post_link('%link', '&rarr;', TRUE); ?></div>
    <div class="clear"></div>
    			<?php endwhile; else : ?>
    
    				<h2 class="center">Not Found</h2>
    				<p class="center">Sorry, but you are looking for something that isn't here.</p>
    				<?php include (TEMPLATEPATH . "/searchform.php"); ?>
    
    			<?php endif; ?>
    <?php comments_template(); ?>
    </div>
    </div>
    
    <?php
    		$sidebar_state = get_option('T_sidebar_state');
    
    		if($sidebar_state == "On") {
    			get_sidebar() ;
    		}
    		else {
    			echo "";
    		}
    		?>
    
    <!-- Begin Footer -->
    <?php get_footer(); ?>

    page-wide.php:

    <?php
    /*
    Template Name: Wide Page
    */
    ?>
    <?php get_header(); ?>
    <div class="span-24 first last">
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    			<h2><?php the_title(); ?></h2>
    			<?php include (THEMELIB . '/apps/multimedia.php'); ?>
    			<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
    			<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    		</div>
    		<div class="clear"></div>
    		<?php endwhile; endif; ?>
    	<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
    <?php get_footer(); ?>

    I just had a look at the actual theme files … the main problem is in the file /library/apps/blog.php

    <div class="entry">
    <?php if ($i == 1) {
        include (THEMELIB . '/apps/multimedia.php');
        the_content();
        }
        else {
        postimage('thumbnail');
        the_excerpt();
        }
        ?>
    </div>

    This bit within the loop is what prevents all posts other than the first from displaying in full. The while statement is keeping track of $i and when $i is 1, it returns the_content() and for all others the_excerpt.

    Is this problem only on the home page?

    Try changing that block to something like this:

    <div class="entry">
    <?php
        include (THEMELIB . '/apps/multimedia.php');
        the_content();
    ?>
    </div>

    Eliminate the conditional excerpt and they’ll probably all display in full.

    Thread Starter rkell

    (@rkell)

    keighl you are a champion – thank you very much for your help on this!
    I was worried my lack of knowledge here would have me completely stuffed, but your suggestion has yielded exactly what I wanted.
    Cheers!

    Thank you so much Keighl. I had the same problem that my pictures were not showing other than on the most recent post. I changed the code and all is hunky dorey 🙂 I also have a problem that the hyperlinks don’t show but that i can live with more than no pictures. Cheers, Pete http://www.teaco-photography.com

    keighl, you’re my hero, you saved me :)…Thank you for taking the time to post an explanation so clear!

    Hi, I’m having a similar problem. I have a site ( My Little Rock Jobs ) with the Simplish theme, and I can’t get the Search Results page to show the full posts. I’ve tried adding in <?php the_content(); ?> in certain spots in “_posts.php”, but it just duplicates the post content on the homepage and category pages. Here is the code for _posts.php:

    <?php if (!is_404() && have_posts()) : while (have_posts()) : the_post(); ?>
    	<?php if(is_single()):?>
    
    	<?php endif;?>
    
    	<div class="postwrap fix">
    
    		<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    			<?php if(!is_page()):?>
    			<div class="copy fix">		
    
    					<?php if(pl_show_thumb($post->ID)): ?>
    			            		<div class="thumb left">
    									<a>" rel="bookmark" title="<?php _e('Permanent Link To', TDOMAIN);?> <?php the_title_attribute();?>">
    										<?php the_post_thumbnail('thumbnail');?>
    									</a>
    					            </div>
    					<?php elseif (get_post_meta($post->ID, 'thumb', true)): ?>
    						<?php $postimageurl = get_post_meta($post->ID, 'thumb', true); ?>
    		            	<div class="thumb left">
    			              <a>" rel="bookmark" title="<?php _e('Permanent Link To', TDOMAIN);?> <?php the_title_attribute();?>">
    							<img src="<?php echo $postimageurl; ?>" alt="Post Pic" width="200" height="200" />
    						</a>
    			            </div>
    					<?php endif; ?>
    
    					<div class="post-header fix <?php if(!pl_show_thumb($post->ID) && !get_post_meta($post->ID, 'thumb', true)) echo 'post-nothumb';?>">
    						<div class="post-title-section fix">
    							<div class="post-title fix">
    								<h2><a>" rel="bookmark" title="<?php _e('Permanent Link to',TDOMAIN);?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    
    								<div class="metabar">
    									<em>
    									<?php _e('',TDOMAIN);?> <?php the_time(get_option('date_format')); ?> - <?php the_time('g:i a'); ?>  -
    									<?php _e('Posted in: Little Rock',TDOMAIN);?> <b><?php the_category(', ') ?></b>
    									<?php edit_post_link(__('<strong>(Edit Post)</strong>', TDOMAIN), ' ', ' ');?>
    									</em>
    								</div>
    							</div>
    						</div>
    						<!--/post-title -->
    
    						<?php if(pl_show_excerpt($post->ID)):?>
    								<div class="post-excerpt">
    									<?php the_content(); ?>
    								</div>
    						<?php endif; ?>
    					</div>				
    
    			</div>
    			<?php endif;?>
    			<?php if(pl_show_content($post->ID) || is_category()):?>
    				<div class="copy fix">
    					<?php if(pagelines('pagetitles') && is_page()  || is_page_template('page-feature-blog.php')):?>
    						<h1 class="pagetitle"><?php the_title(); ?></h1>
    					<?php endif;?>
    					<div class="textcontent">
    
    						<?php the_content(__('<p>Continue reading »</p>',TDOMAIN)); ?>
    						<?php wp_link_pages(__('<p><strong>Pages:</strong>', TDOMAIN), '</p>', __('number', TDOMAIN)); ?>
    						<?php edit_post_link(__('Edit',TDOMAIN), '<p>', '</p>'); ?>
    					</div>
    				</div>
    				<?php if(pagelines('authorinfo') && is_single()):?>
    					<?php include(THEME_LIB.'/_authorinfo.php');?>
    				<?php endif;?>
    			<?php endif;?>
    
    		</div><!--post -->
    
    	</div>
    
    	<?php if(!is_page()):?>
    		<div class="tags">
    			<?php the_tags(__('Tagged with: ', TDOMAIN),' • ',''); ?> 
    		</div>
    	<?php endif;?>
    
    	<div class="clear"></div>
    
    		<?php if(is_single() || is_page()):?>
    
    			<?php if(VPRO) include(THEME_LIB."/_contentsidebar.php");?>
    
    		<?php endif; endwhile; ?>
    
    	<?php include(THEME_LIB.'/_pagination.php');?>
    
    	<?php else : ?>
    		<div class="postwrap fix">
    			<div class="hentry">
    			<div class="billboard">
    				<?php if(is_404()):?>
    					<h2 class="center"><?php _e('Page Not Found - Error 404',TDOMAIN);?></h2>
    				<?php else:?>
    					<h2 class="center"><?php _e('Nothing Found',TDOMAIN);?></h2>
    				<?php endif;?>
    				<p class="center"><?php _e('Try browsing by job type, or searching below.', TDOMAIN);?></p>
    				<div class="center fix"><?php get_search_form(); ?></div>
    			</div>
    			</div>
    		</div>
    <?php endif; ?>

    I found this post incredibly helpful. I’m new at wordpress and know VERY little html. I’m getting quite the crash course trying to change these templates to do what I want them to do.

    I have two issues…

    I also have the Modularity Lite theme. I actually liked the fact that the first image showed the full post then had the excerpt posts below it. BUT, with the new 1.3 upgrade, that changed. So here’s one of my questions, how do I change it back?? The entry section is much different to what you talk about above:

    <div class="entry">
    						<?php the_content( __( 'Read the rest of this page &raquo;', 'modularity' ) ); ?>
    						<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'modularity' ), 'after' => '</div>' ) ); ?>
    					</div>

    My second question is about the font. Again, I like the font that was there before. (I know, I shouldn’t have upgraded!) how do I figure out what font that was and how do I change it back?

    Any help is MUCH appreciated!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Show Full Posts on main page?’ is closed to new replies.