Forums

changing an the_excerpt to a regular post (19 posts)

  1. twangnation
    Member
    Posted 1 month ago #

    Hi, I am currently using a theme (Cellar Heat Dark) that has the newest post on the home page as an "the_excerpt."

    This features does not support pictures or HTML formatting so I'd like to make it a regular post. How might I do this?

    Thanks in advance.

    See my site here http://www.twangnation.com

  2. songdogtech
    Member
    Posted 1 month ago #

    In index.php, change the_excerpt to the_content

  3. twangnation
    Member
    Posted 1 month ago #

    songdogtech. thanks for the quick response.

    I changed:

    <?php the_excerpt('Read the rest of this entry »'); ?>

    to

    <?php the_content('Read the rest of this entry »'); ?>

    But no change has resulted.

  4. songdogtech
    Member
    Posted 1 month ago #

    You just need <?php the_content;?> Change in home.php, index.php; maybe in category.php, too, if you want that.

  5. twangnation
    Member
    Posted 1 month ago #

    I changed the_excerpt in the index to:

    <?php the_content( $more_link_text, $strip_teaser, $more_file ); ?>

    But it has no effect. This is in the feature.php file:

    /* previous, next posts */

    function tl_excerpt($text, $excerpt_length = 80) {
    $text = str_replace(']]>', ']]>', $text);
    $text = strip_tags($text);
    $words = explode(' ', $text, $excerpt_length + 1);
    if (count($words) > $excerpt_length) {
    array_pop($words);
    array_push($words, '[...]');
    $text = implode(' ', $words);
    }

    return apply_filters('the_excerpt', $text);
    }

    function tl_post_excerpt($post) {
    $excerpt = ($post->post_excerpt == '') ? (tl_excerpt($post->post_content))
    : (apply_filters('the_excerpt', $post->post_excerpt));
    return $excerpt;
    }

    function previous_post_excerpt($in_same_cat = false, $excluded_categories = '') {
    if ( is_attachment() )
    $post = &get_post($GLOBALS['post']->post_parent);
    else
    $post = get_previous_post($in_same_cat, $excluded_categories);

    if ( !$post )
    return;
    $post = &get_post($post->ID);
    echo tl_post_excerpt($post);
    }

    function next_post_excerpt($in_same_cat = false, $excluded_categories = '') {
    $post = get_next_post($in_same_cat, $excluded_categories);

    if ( !$post )
    return;
    $post = &get_post($post->ID);
    echo tl_post_excerpt($post);
    }

    --and I'm wondering if this is having an overriding effect?

  6. songdogtech
    Member
    Posted 1 month ago #

    Probably. Try just <?php the_content;?> without ($more_link_text, $strip_teaser, $more_file );

  7. twangnation
    Member
    Posted 1 month ago #

    Okay, tried just what you suggested and there's no change.

  8. songdogtech
    Member
    Posted 1 month ago #

    Sorry, I'm missing that's probably something obvious. Check the theme author's site and see if there's an answer there.

  9. twangnation
    Member
    Posted 1 month ago #

    Thanks for the help songdogtech.

    I've posted at the authors page but nothing yet.

  10. twangnation
    Member
    Posted 1 month ago #

    Okay, I've determined the the_excerpt code in the functions.php is not affecting the current post. So I changed the the_excerpt in the index.php to:

    <?php the_content( $more_link_text, $strip_teaser, $more_file ); ?>

    But the current post is still showing up as a the_excerpt style post (55 characters, no pics, no HTML code)

    Here is the whole index.php. Please take a look and let me know how to make my current post a regular one. Thanks.

    ---------------------------------------------------------------------

    <?php get_header(); ?>
    <div id="container">
    <ul id="nav">
    <li class="<? echo (is_home())?'current_page_item':''; ?>">/">Home
    <?php $pages = wp_list_pages('sort_column=menu_order&depth=1&title_li=&echo=0');
    echo $pages; ?>

    <? unset($pages); ?>
    <br clear="all" />
    <div id="search"><form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
    <input type="submit" id="searchsubmit" class="btnSearch" value=" " />
    <input type="text" value="<?php the_search_query(); ?>" name="s" id="s" class="txtField" />
    </form></div>
    <div id="site-name">/"><?php bloginfo('name'); ?>
    <span class="description"><?php bloginfo('description'); ?></span></div>
    <div class="spacer"></div>
    <div id="recent-posts">
    <!-- post begin -->
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="home-post" id="post-<?php the_ID(); ?>">
    <div class="upper">
    <div class="fade"></div>
    <h3>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></h3>
    <span class="meta"><?php the_time('F') ?> <?php the_time('jS') ?> <?php the_time('Y') ?></span>
    <?php the_content( $more_link_text, $strip_teaser, $more_file ); ?>
    </div>
    <span class="btn-readon">" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Read On</span>
    <span class="lower-meta"><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span>
    </div>
    <?php endwhile; ?>
    <br clear="all" />
    <?php else: ?>
    <div class="search-results"><span class="bigger">Search Results...</span>
    <?php _e('Sorry, no posts matched your criteria.'); ?></div>
    <?php endif; ?>
    <!-- post end -->
    <div id="page-nav"><span class="older"><?php next_posts_link('Older Entries') ?></span><span class="newer"><?php previous_posts_link('Newer Entries') ?></span></div>
    <br clear="all" />
    </div>
    </div>
    <div class="lower-outer">
    <div id="lower">
    <?php get_sidebar(); ?>
    </div>
    <?php get_footer(); ?>

  11. songdogtech
    Member
    Posted 1 month ago #

    Ouch. Can't believe I did that. Several times. Try just <?php the_content();?> . I forgot the ()'s in the statement.....

    And then delete <span class="btn-readon">" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Read On</span>, too.

    Let me know if that works.

  12. twangnation
    Member
    Posted 1 month ago #

    songdogtech, did as you recommended and no change resulted. Here's what I have now:

    <!-- post begin -->
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="home-post" id="post-<?php the_ID(); ?>">
    <div class="upper">
    <div class="fade"></div>
    <h3>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></h3>
    <span class="meta"><?php the_time('F') ?> <?php the_time('jS') ?> <?php the_time('Y') ?></span>
    <?php the_content();?>
    </div>

    <span class="lower-meta"><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span>
    </div>

  13. songdogtech
    Member
    Posted 1 month ago #

    Jeez; one more erorr I didn't see at first. The permalink to the post was broken from some other edit. Try this block of code to replace the above block:

    <!-- post begin -->
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="home-post" id="post-<?php the_ID(); ?>">
    <div class="upper">
    <div class="fade"></div>
    
    <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
    
    <span class="meta"><?php the_time('F') ?><?php the_time('jS') ?><?php the_time('Y') ?></span>
    <?php the_content();?>
    </div>
    
    <span class="lower-meta"><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span>
    </div>
  14. twangnation
    Member
    Posted 1 month ago #

    replaced and no change. Thanks for taking the time songdogtech,

  15. songdogtech
    Member
    Posted 1 month ago #

    I have no idea now, other than are using page template rather than index.php? Like home.php?

  16. twangnation
    Member
    Posted 1 month ago #

    Yes! I do have a home.php!

  17. songdogtech
    Member
    Posted 1 month ago #

    That's probably it; make the changes in home.php. In Wordpress, home.php overides index.php. Try that block of code; many themes have the close to the same block of code in home and index.

  18. twangnation
    Member
    Posted 1 month ago #

    I think that's doe it. I still get a "read full post" button even when the whole post id displayed and the styling is wonky, but I think I now have a regular post.

    Thanks for all your help!

  19. songdogtech
    Member
    Posted 1 month ago #

    Wow. Finally. Glad that worked. I think to get rid of the "Read Full Post", delete:

    <span class="btn-readon"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Read On</span>

    You might end up with some spacing issues, though.

Reply

You must log in to post.

About this Topic