Support » Themes and Templates » post_excerpt bug in get_post?

  • Hi

    $special_post_info = get_post($id);
    $exce = $special_post_info->post_excerpt;

    $exce is ever blank because post_excerpt in get_post is ever blank. Is it a bug?

Viewing 3 replies - 1 through 3 (of 3 total)
  • ->post_excerpt only contains the manually entered excerpt – not the automatically generated.

    Moderator keesiemeijer

    (@keesiemeijer)

    try:

    global $post;
    $special_post_info = get_post($id);
    setup_postdata($special_post_info);
    $exce = the_excerpt();

    I’m out of loop. So, it works so:

    global $post;
    $special_post_info = get_post($id);
    setup_postdata($special_post_info);
    $exce = $special_post_info->post_excerpt;

    Thanks keesiemeijer

    @alchymyth: post_excerpt ever was blank. With manually entered excerpt was the same

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘post_excerpt bug in get_post?’ is closed to new replies.