Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Montezuma Theme (http://forum.bytesforall.com/forumdisplay.php?f=53)
-   -   [SOLVED] How do I customize the teaser for each blog post on my main page (http://forum.bytesforall.com/showthread.php?t=19041)

domino66 Dec 4, 2012 04:57 PM

[SOLVED] How do I customize the teaser for each blog post on my main page
 
Probably a noob Q, but I can't figure it out. I write blog posts, and the default Montezuma treatment is to just grab the first few sentences, and display them as the teaser/excerpt on my blog's main page.

But I actually want to write completely customized excerpts for my blog posts to appear as the teasers. For example, a blog post may start "I'm going to write all about my favorite restaurants..."

But I want the TEASER / excerpt that appears on my blog's main page to just say something like "Check out my trip reports for Chicago's best restaurants"

How do I do that?

juggledad Dec 4, 2012 05:16 PM

if you manually craft an excerpt in the post edit, it will automatically show up.

domino66 Dec 4, 2012 06:20 PM

Quote:

Originally Posted by juggledad (Post 93342)
if you manually craft an excerpt in the post edit, it will automatically show up.

I tried that but it didn't work. See screenshot below. Is that the EXCERPT field you're telling me to use? Because I tried, but the theme didn't use the text I put in there. It just continued to use the first couple sentences from the blog post itself.

http://img84.imageshack.us/img84/1669/herea.jpg

juggledad Dec 4, 2012 06:50 PM

edit the subtemplate 'postformat.php' and change the line
HTML Code:

                <?php bfa_excerpt( 55, ' ...' ); ?>
to
HTML Code:

                <?php the_excerpt(); ?>

domino66 Dec 4, 2012 07:24 PM

Quote:

Originally Posted by juggledad (Post 93363)
edit the subtemplate 'postformat.php' and change the line
HTML Code:

                <?php bfa_excerpt( 55, ' ...' ); ?>
to
HTML Code:

                <?php the_excerpt(); ?>

Thanks very much; almost there...except that for some reason now my teaser (on my main blog page) looks like this...with an extraneous ellipsis and "Read More" in there:

http://img87.imageshack.us/img87/4286/whyaf.jpg

FWIW, my subtemplate now looks like:

Quote:

<div id="post-<?php the_ID(); ?>" <?php post_class( 'cf' ); ?>>

<h2>
<span class="post-format"></span>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></a>
<?php bfa_comments_popup_link( '0', '1', '%' ); ?>
</h2>

<?php bfa_thumb( 620, 180, true, '<div class="thumb-shadow"><div class="post-thumb">', '</div></div>' ); ?>

<div class="post-bodycopy cf">

<div class="post-date">
<p class="post-month"><?php the_time( 'M' ); ?></p>
<p class="post-day"><?php the_time( 'j' ); ?></p>
<p class="post-year"><?php the_time( 'Y' ); ?></p>
</div>

<?php the_excerpt(); ?>

</div>

<div class="post-footer">
<a class="post-readmore" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php _e( 'read more &rarr;', 'montezuma' ); ?></a>
<p class="post-categories"><?php the_category( ' &middot; ' ); ?></p>
<?php the_tags( '<p class="post-tags">', '', '</p>' ); ?>
</div>

</div>

domino66 Dec 5, 2012 03:02 PM

bump; any ideas? I can't for the life of me figure out where that ... and 'read more' text is coming from!?

juggledad Dec 5, 2012 05:41 PM

try removing teh
HTML Code:

<?php _e( 'read more &rarr;', 'montezuma' ); ?></a>

domino66 Dec 10, 2012 09:39 AM

Quote:

Originally Posted by juggledad (Post 93409)
try removing teh
HTML Code:

<?php _e( 'read more &rarr;', 'montezuma' ); ?></a>

Nope, removing that line makes the WRONG "read more" disappear (see below)...this is really weird. I can't figure out where that line is coming from!?

http://img843.imageshack.us/img843/1102/surew.jpg

EDIT: maybe this helps...when i delete this line entirely:
<?php the_excerpt(); ?>

the ugly '...read more' disappears too (but so does the entire excerpt, obv).
So i guess what i'm trying to get rid of resides in the the_excerpt element. Where do i find that thing to tweak it?

domino66 Dec 10, 2012 10:06 AM

Solved:

looked in the functions.php file and found this, and removed the bolded line (tell me, I suppose, if I shouldn't have done that, or whether it'll cause problems in the future.):

// Add custom Read More link to manual excerpts:
function bfa_custom_excerpt_more( $output ) {
if ( has_excerpt() && ! is_attachment() )
$output .= bfa_read_more_link();
return $output;
}

add_filter( 'get_the_excerpt', 'bfa_custom_excerpt_more' );


All times are GMT -6. The time now is 08:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.