The MU forums have moved to

rss images not showing wpmu 2.8.4a (2 posts)

  1. jrevillini
    Posted 14 years ago #

    I cannot get images to come up as enclosures in WPMU 2.8.4a. I'm using the WP RSS Images plugin. The get_children function returns nothing every time. I've tried modifying the query string quite a few times to no avail. Here are the pertinent parts of the code (modified from original plugin source for debugging purposes):

    if ($rss2_img_ch == 1)  add_action('rss2_item', 'wp_rss_include');
    function wp_rss_include (){
    $image_size = get_option('rss_image_size_op');
    if (isset($image_size)) $image_url = rss_image_url($image_size);
    else  $image_url = rss_image_url('medium');
    function rss_image_url($default_size = 'medium') {
    	global $post;
    	$args = array(
    	'post_type' => 'attachment',
    	'numberposts' => -1,
    	'post_status' => null,
    	'post_parent' => $post->ID, // any parent
    	$attachments = get_posts($args);
    	if ($post->ID == 3231) print_r($attachments);die('bah');

    My output does end with 'bah', but there's no array output preceding it.

    I've tried post_status set to inherit, numberposts set to 1, i've removed arguments, added post_mime_type set to 'image', tried changing post_type to 'revision' (because I know that when it's called from the footer of the edit post page, get_children is working as expected). It's as if something about the Loop that I'm in forbids query_posts from returning children.

    Very strange. I'm very comfortable messing around in PHP so don't hold back.

  2. jrevillini
    Posted 14 years ago #

    ARGH!!!! My fault - I was using a category exclusion plugin which was, for some reason, excluding my attachments from rss feeds. *sigh*

    Feel free to delete this topic, admins.

About this Topic

  • Started 14 years ago by jrevillini
  • Latest reply from jrevillini