changing an the_excerpt to a regular post
-
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 https://www.twangnation.com
-
In index.php, change
the_excerpt
tothe_content
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.
You just need
<?php the_content;?>
Change in home.php, index.php; maybe in category.php, too, if you want that.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?
Probably. Try just
<?php the_content;?>
without($more_link_text, $strip_teaser, $more_file );
Okay, tried just what you suggested and there’s no change.
Sorry, I’m missing that’s probably something obvious. Check the theme author’s site and see if there’s an answer there.
Thanks for the help songdogtech.
I’ve posted at the authors page but nothing yet.
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(); ?>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.
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>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>
replaced and no change. Thanks for taking the time songdogtech,
I have no idea now, other than are using page template rather than index.php? Like home.php?
Yes! I do have a home.php!
- The topic ‘changing an the_excerpt to a regular post’ is closed to new replies.