formatting the post_content outside of loop
-
Greeting all. I just posted this to the wp-hackers groups and figuered that was wrong since this is a support issue. (more like dumb user issue).
Here is my code:
$post_email = get_post($email_post_id);
setup_post($post_email);The functionality is pretty basic. I’m calling get_post with an ID that was determined earlier in the code. This does properly populate the ‘post_email’ variable. I’m calling ‘setup_post’ as someone suggested in an article I found in these forums.
My problem is I’m building an HTML email I need to get access to the formatted post output. Normally on a page I would just call the_content() and the properly formatted body would be displayed. Problem is the the_content() function will echo the formatted output to the screen. I need to redirect this same output instead to a local variable to be echoed to the HTML email content.
So how is this done? I know someone somewhere has done this before.
P-
- The topic ‘formatting the post_content outside of loop’ is closed to new replies.