WordPress.org

Support

Support » How-To and Troubleshooting » get_excerpt() returns empty string

get_excerpt() returns empty string

  • ecsancho

    @ecsancho

    Greetings

    I’m grabbing a post outside the loop by using $p=get_post(id). However wen trying to grab excerpt directly from post by using $p->post_excerpt or get_excerpt(id) and both returning empty. What gives? Em I missing something? Thanks in advance.

Viewing 1 replies (of 1 total)
  • ecsancho

    @ecsancho

    Solved it by using setup_postdata( $p ); echo get_the_excerpt();

Viewing 1 replies (of 1 total)
  • The topic ‘get_excerpt() returns empty string’ is closed to new replies.
Skip to toolbar