get_posts and wp_autop (remove filter)

You could make your own excerpt function:

    function wpse125086_custom_strip_tags_excerpt() {
        global $post;
        $p_obj = get_post($post->ID);
        $p_exp = $p_obj->post_excerpt;
        $p_exp = apply_filters('the_excerpt', $p_exp);
        $un_p = array("<p>", "</p>");
        $p_exp = str_replace($un_p, "", $p_exp);
        echo $pcont;
    }

But generally I’m thinking instead of transforming to get_posts() it might be better to go with WP_Query. In this case the standard filter you’re using should work just fine.


Edit:

If it’s about the opening/closing <p></p> tags, you can just go with get_the_excerpt(), because it doesn’t add those. you have to echo it to print the excerpt out.

echo get_the_excerpt();

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)