Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter atakajeff

    (@atakajeff)

    Partially solved, created a separate custom feed, just need to get it to include the featured image so it is aggregated by the plugin

    Thread Starter atakajeff

    (@atakajeff)

    Alright, I set up up the custom feed and added the following codes courtesy of Yoast to include the image

    xmlns:media="http://search.yahoo.com/mrss

    <?php if(get_the_post_thumbnail()): ?>
    <media:content url="<?php echo wp_get_attachment_url(get_post_thumbnail_id($post->ID)); ?>" medium="image" />
    <?php endif; ?>

    I then added an external featured image link plugin which I modified to use catch that image to fill in the input field

    NOW, my last issue is pulling the RSS description or content to use in my custom post type loop which is displaying the aggregated feed items turned posts.

    Referencing $items[“mydesc”] has no result, so I’m sure I’m doing something wrong.

    Basically, I have a meta field’s data (a single hyperlink per post) placed in the description channel of my RSS feed. I’d like to take that description/link and use it as a link within the loop.

    Plugin Author Allen

    (@amweiss98)

    the plugin works by getting the content tag for the content, not the description tag (the description tag is not supposed to have the main content for an RSS feed, but a short synopsis of the content)

    to get the description you have to alter the import_feeds.php file, but of course, that will results in only getting the description which means that on almost all RSS feeds the result will be nothing in that tag.

    Thread Starter atakajeff

    (@atakajeff)

    Gotcha! I saw in an earlier thread that you had said the same thing, but I found no way to call on the content. Is there a variable I can call on to include this information within my separate loop template?

    Thread Starter atakajeff

    (@atakajeff)

    Figured what I wanted to above is not possible, so I came up with a work around. Since I’m not using the excerpt field, I can do

    if (! $items["mydesc"]){$post['post_excerpt'] = $items["mylink"];}
    else {$post['post_excerpt'] = $items["mydesc"];}

    And then use that in my loop. Can link to both the defined, external permalinks or the original source post this way.

    Was also thinking about adding in a function to look for links in the post content, since the individual post pages will not be accessible, but I figured the excerpt solution was simpler.

    Is there a more appropriate way to go about doing this or would you say this workaround is suitable? I also tried using add/update meta data to pre set the custom field that is actually used for this info, so I can avoid making the if excerpt exists call in my loop, but it didn’t work out.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Import custom post type feed’ is closed to new replies.