[wp-hackers] return automatic excerpt?
Michael B
miklb.online at gmail.com
Thu Nov 2 23:01:48 GMT 2006
Well, as I said, I'm muddling my way through this. But I'm not trying to
get the content, rather the excerpt. I can output the content via the
method I'm using now.
~miklb
On 11/2/06, Computer Guru <computerguru at neosmart.net> wrote:
>
> Why do it manually?
>
> Use the_content() to grab the post of your liking. It'll take care of all
> that for you.
>
> To use the_content() just first run the SQL query that picks the post
> number(s), then activate the_content() or get_the_content() depending on
> your needs.
>
> Computer Guru
> NeoSmart Technologies
> http://neosmart.net/blog/
>
>
> > -----Original Message-----
> > From: wp-hackers-bounces at lists.automattic.com [mailto:wp-hackers-
> > bounces at lists.automattic.com] On Behalf Of Michael B
> > Sent: Friday, November 03, 2006 12:44 AM
> > To: wp-hackers at lists.automattic.com
> > Subject: [wp-hackers] return automatic excerpt?
> >
> > I'm muddling my way through customizing a random post plugin to output
> > the
> > excerpt of a post with a read more link. Currently it's only working
> > if I
> > put a manual excerpt in the post, how can I automatically output the
> > excerpt.
> >
> > Here's the code I'm using:
> > $listContent = stripslashes(str_replace('"', '',
> > $display->post_excerpt));
> >
> > // Set up the return string
> > if ( $before ) $result .= $before;
> > $result .= '<a href="' . post_permalink($display-
> > >ID) .
> > '" rel="bookmark" title="Permanent link to "' . $listTitle .
> > '"">'
> > . $listTitle . '</a>' . '<br />' . $listContent . '<a href="' .
> > post_permalink($display->ID) . '" rel="bookmark" title="Permanent link
> > to
> > "' . $listTitle . '"">' . ' Read more' . '</a>' ;
> >
> > Currently I'm simply pulling the field via
> > $postSQL = "SELECT
> > $wpdb->posts.post_excerpt";
> >
> > Thanks for any help.
> >
> > ~miklb
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
More information about the wp-hackers
mailing list