• Okay, so I’ve been plying around with my site in an attempt to make it more functional for multi-purposes. I plan to blog, post stories/poetry, post art, etc, etc, etc. Now Lorelle VanFossen ultimately has the method I’m looking for (see it here, but I can only seem to implement part of it or not at all.

    The idea is to be able to have:
    1) Excerpts with a Read More link
    2) Read More (general purpose)
    3) Full Post

    You can kind of get a picture at my site.

    For example, I want to post Poetry on the frontview as Full Posts. But for a chaptered story, I want an excerpt with a Read ‘title of the story’, as I’m using this in pages. And for some posts, I want to be able to use the more tag to split up certain posts at specified points, but still leave the ability to read the ENTIRE post as a whole.

    <?php get_header(); ?>
    <?php get_sidebar(); ?>
    
    		<!-- Content -->
    		<div id="content">
    
    			<?php if (have_posts()) : ?>
    			<?php while (have_posts()) : the_post(); ?>
    			<!-- Post -->
    
    			<div class="post" id="post-<?php the_ID(); ?>">
    				<div class="post-title">
    					<div class="post-date">
    						<span><?php the_time('d') ?></span>
    						<?php the_time('M') ?>
    					</div>
    					<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    					Author: <?php the_author() ?> &nbsp;// &nbsp;Category: <?php the_category(', ') ?>
    				</div>
    				<div class="post-entry">
    <strong><?php
    if( $post->post_excerpt ) {
        the_excerpt();
    } else {
        the_content();
    }
    ?></strong>
    
    <center><h3><?php link_pages(''); ?></h3></center>
    
    				</div>
    
    				<div class="post-info">
    					<?php comments_popup_link('Comments (0)', 'Comment (1)', 'Comments (%)'); ?> &nbsp;// &nbsp;<a href="<?php the_permalink() ?>#respond">Add Comment</a>
    				</div>
    			</div>
    			<!-- /Post -->
    			<?php endwhile; ?>
    			<!-- Navigation -->
    			<div class="navigation">
    				<div class="navigation-previous"><?php next_posts_link('&laquo; Previous Entries') ?></div>
    				<div class="navigation-next"><?php previous_posts_link('Next Entries &raquo;') ?></div>
    			</div>
    			<!-- /Navigation -->
    			<?php else : ?>
    			<!-- Post -->
    			<div class="post">
    				<div class="post-title">
    					<h2>Not Found</h2>
    				</div>
    				<div class="post-entry">
    					Sorry, but you are looking for something that isn't here.
    
    				</div>
    			</div>
    			<!-- /Post -->
    			<?php endif; ?>
    
    			<div class="clear"></div>
    
    		</div>
    		<!-- /Content -->
    
    <?php get_footer(); ?>

    The above is what I am currently using for my index.
    I’ve looked throughout the forum but haven’t found anything on the simple side that will work. I’ve also tried solutions found on other searches, but they just break. I can get a read more link, but it either breaks my site or links to the main page and not the story itself. The permalink doesn’t seem to work correctly. I attempted to use Lorelle’s method, almost verbatim, but the page always broke.

    Any ideas? I was hoping for a simple ‘echo’ or ‘else’ function that can integrate with the code that works somewhat okay for me right now.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter nekobaby

    (@nekobaby)

    Okay…. it didn’t bold….

    <?php
    if( $post->post_excerpt ) {
        the_excerpt();
    } else {
        the_content();
    }
    ?>

    This is what I’m using currently.

    Thread Starter nekobaby

    (@nekobaby)

    This is the solution, I think. My friend emailed it to me about a minute ago… Seems to work fine. Might need a bit of tweaking layout wise, but it allows for the excerpt with read more, the read more tag, and showing full posts on the frontpage.

    <?php if($post->post_excerpt) :
     the_excerpt(); ?><a href="<?php the_permalink() ?>" rel="bookmark" title="Read <?php the_title(); ?>">Read <?php the_title(); ?></a> ?
    <?php else:
     the_content();
     endif;
     ?>

    Thank you very much! This made things easier for me.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Excerpt, More, Full Content’ is closed to new replies.