[1]

acajou04
Subscriber
November 21st, 2008 at 11:30 am

Wordpress Version: 2..6.x

TDO Mini Forms Version: 0.12.5

Operating System (if known): N/A

Webserver Software: N/A

Link to Website: http://

I wonder if anyone can tell me what php is necessary to to append the content of the excerpt widget to the beginning of the main post content?

Why? Well, I need a proper excerpt with image and html tags permitted, but I also want that stuff to form part of the full post.

Cheers

Permalink | Quote

[2]

Mark Cunningham
Administrator
November 21st, 2008 at 1:36 pm

Modify your theme so that it displays the extract above the content, say in single.php:


<?php
the_excerpt();
the_content('Read More...');
?>

Permalink | Quote

[3]

acajou04
Subscriber
November 21st, 2008 at 1:40 pm

Oh man, that’s too easy. Here was I wishing I understood more of PHP and searching for the variables to append and now I just feel a mite embarrassed at how simple your solution is. :P Thanks!

Permalink | Quote

[4]

Mark Cunningham
Administrator
November 21st, 2008 at 2:56 pm

No problem. :) The only difficulty you’ll have is that your RSS feed displays either an extract or the content… I can’t remember which.

Permalink | Quote

[5]

acajou04
Subscriber
November 22nd, 2008 at 1:20 am

Hmmmm, ok… so out of curiosity, how would you permanently add the excerpt text into the main text? Presumably with an append widget between the excerpt and content widgets with something vaguely in the direction of $post_content => $excerpt_excerpt ?

Permalink | Quote

[6]

Mark Cunningham
Administrator
November 24th, 2008 at 1:00 pm

Yea, I guess you could use the append widget. I haven’t tested this but something like:

<?php
$post = &get_post( $post_id );
if(!empty($post->post_excerpt)) {
echo apply_filters('the_excerpt',$post->post_excerpt);
}
?>

Permalink | Quote

[7]

acajou04
Subscriber
November 25th, 2008 at 12:07 pm

Wow, it worked like a dream! Thanks so much.

Permalink | Quote

Advertisments

Join the Discussion