• I’m using a very helpful script/snippet but getting double results in the Feedburner emails. They are basically Lotto results but the double display is not what I need. The following is the code I’m using in functions.php …

    / ADD CUSTOM POST TYPES TO RSS FEED //
    
    function add_cpts_to_rss_feed( $args ) {
      if ( isset( $args['feed'] ) && !isset( $args['post_type'] ) )
        $args['post_type'] = array('post', 'results');
      return $args;
    }
    
    add_filter( 'request', 'add_cpts_to_rss_feed' );
    //flush();
    
    // ADD CUSTOM FIELDS TO FEED
    function meko6_postrss($content) {
    global $wp_query;
    $postid = $wp_query->post->ID;
    $ba_numbers = get_post_meta($postid, 'ba_numbers', true);
    $ba_supps = get_post_meta($postid, 'ba_supps', true);
    if(is_feed()) {
    if($ba_numbers !== '') {
    $content = $content."<br /><br /><div>".$ba_numbers." [".$ba_supps."]</div>\n";
    }
    else {
    $content = $content;
    }
    }
    return $content;
    }
    add_filter('the_excerpt_rss', 'meko6_postrss');
    add_filter('the_content', 'meko6_postrss');

    I only need one result emailed but if I comment out one of the “add_filter” parts, the whole thing breaks and nothing is sent/emailed

The topic ‘Custom Post Type Custom Fields in Feedburner’ is closed to new replies.