WordPress.org

Ready to get started?Download WordPress

Forums

the_content_rss - not pulling data. (1 post)

  1. stma
    Member
    Posted 6 years ago #

    I've got a bit of a problem with a script I used. Here is the code that worked fine up until the recent 2.1 build.

    $excerpt = get_the_excerpt(true);
        $excerpt = str_replace("\n",'',$excerpt);
        $excerpt = str_replace("\r",'',$excerpt);
        $excerpt = str_replace("\t",'',$excerpt);
        $excerpt = preg_replace('/\s\s+/', ' ', $excerpt);
        $output .= apply_filters('the_excerpt_rss', $excerpt);
        $output .= "\n";

    Prior to the new 2.1 build it worked fine and would pull content even if there was no defined excerpt.

    Now it's not working unless a excerpt is defined for each post. This new code should work - but doesn't pull anything.

    $excerpt = get_the_content(true);
        $excerpt = str_replace("\n",'',$excerpt);
        $excerpt = str_replace("\r",'',$excerpt);
        $excerpt = str_replace("\t",'',$excerpt);
        $excerpt = preg_replace('/\s\s+/', ' ', $excerpt);
        $output .= apply_filters('the_content_rss', $excerpt);
        $output .= "\n";

    I'm finding conflicting information and just need some advice. I've tried pulling out the str_replaces, etc... I've tried different variables in the function names, no go.

Topic Closed

This topic has been closed to new replies.

About this Topic