Support » Fixing WordPress » the_excerpt

  • Resolved intcon

    (@intcon)


    Hi..

    I’ve read where you change the_excerpt into the_content to change blog posts to show the entire post instead of just an excerpt..

    here’s what my code in index.php says

    <div class="post-content">
      		          <?php $post_excerpt = of_get_option('post_excerpt'); ?>
      		      		<?php if ($post_excerpt=='true' || $post_excerpt=='') { ?>
      		            <div class="excerpt"><?php $excerpt = get_the_excerpt(); echo my_string_limit_words($excerpt,45);?>

    which excerpt do i change?

    thanks!

    carrie

Viewing 4 replies - 1 through 4 (of 4 total)
  • Michael

    (@alchymyth)

    Forum Moderator

    your posted section is only part of a possibly more relevant code;

    can you poast the full code of that template?
    (see forum guidelines for posting code)

    intcon

    (@intcon)

    Michael

    (@alchymyth)

    Forum Moderator

    in the most simple case, try and replace this section:

    <?php $post_excerpt = of_get_option('post_excerpt'); ?>
                                    <?php if ($post_excerpt=='true' || $post_excerpt=='') { ?>
                                <div class="excerpt"><?php $excerpt = get_the_excerpt(); echo my_string_limit_words($excerpt,45);?></div>
                              <?php } ?>

    with:

    <div class="excerpt"><?php the_content(); ?></div>

    OR alternatively (experimental as I don’t know exactly what the theme option does):

    there seems to be a theme option to select to show the excerpt or nothing; if you want to keep this and change it to excerpt or content, then change the section to:

    <?php $post_excerpt = of_get_option('post_excerpt'); ?>
                                    <?php if ($post_excerpt=='true' || $post_excerpt=='') { ?>
                                <div class="excerpt"><?php $excerpt = get_the_excerpt(); echo my_string_limit_words($excerpt,45);?></div>
                              <?php }
    else { ?>
    <div class="excerpt"><?php the_content(); ?></div>
    <?php } ?>
    intcon

    (@intcon)

    woohoo!! the first one worked…thanks so much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘the_excerpt’ is closed to new replies.