Flipboard provides a digital web and mobile-distribution platform for original content from publishers around the world. It can help you distribute to and connect with people who are passionate about your content. As a blogger or news outlet the biggest hurdle is how you can get traffic for your site, Flipboard can help you grow traffic to your website and to do that you will need to become publisher on the platform. Often, your submission will be rejected, for failing to meet the Flipboard RSS Guidelines. If you are using WordPress, this would be definitely because, your images are not included in the enclosure node for each item in the feed.
According to Flipboard you must use the <enclosure> tag to add a media element that will be used in layout view to illustrate your article. It can be an image or a video. For videos, mobile-friendly mp4 format is strongly preferred. For images, prefer a high-resolution image; the smallest dimension should not be under 500px.
People have been asking us how our publisher profile and RSS got approved. You can follow the steps below, to remedy the issue with enclosure node.
function feedFilter($query) {
if ($query->is_feed) {
add_filter('rss2_item', 'feedContentFilter');
}
return $query;
}
add_filter('pre_get_posts','feedFilter');
/* BEGIN SNIPPET
----------------------------------------- */
/**
* Get Remote File Size
*
* @param string $url as remote file URL
* @return int as file size in byte
*/
function remote_file_size($url) {
# Get all header information
$data = get_headers($url, true);
# Look up validity
if (isset($data['Content-Length']))
# Return file size
return (int) $data['Content-Length'];
}
/* END SNIPPET
----------------------------------------- */
function feedContentFilter($item) {
global $post;
$args = array(
'order' => 'ASC',
'post_type' => 'attachment',
'post_parent' => $post->ID,
'post_mime_type' => 'image',
'post_status' => null,
'numberposts' => 1,
);
$attachments = get_posts($args);
if ($attachments) {
foreach ($attachments as $attachment) {
$image = wp_get_attachment_image_src($attachment->ID, 'full');
$mime = get_post_mime_type($attachment->ID);
}
}
if ($image) {
echo '<enclosure url="'.$image[0].'" length="'.$image[1].'" type="'.$mime.'"/>';
}
return $item;
}
Alternatively you can add the code below to the ‘functions.php’ file of your theme.
function rss_post_thumbnail($content) {
global $post;
if(has_post_thumbnail($post->ID)) {
$content = '<p>' . get_the_post_thumbnail($post->ID) .
'</p>' . get_the_content();
}
return $content;
}
add_filter('the_excerpt_rss', 'rss_post_thumbnail');
add_filter('the_content_feed', 'rss_post_thumbnail');
Victor Mochere is an award winning blogger, social media influencer, literati savant, altruistic, and a netpreneur creating and marketing digital content.
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Permission to use quotation from any article is granted subject to full credit of the source being given by referencing the direct link of the article on Victor Mochere. However, reproducing any content on this site without explicit permission is strictly prohibited.
We are committed to upholding our editorial standards, including accuracy. Our policy is to review each issue on a case by case basis, immediately upon becoming aware of a potential error or need for clarification, and to resolve it as quickly as possible. If you notice an error or typo that needs correction, please don’t hesitate to contact us for immediate action.
Victor Mochere brings you a daily dose of well curated up to date facts, news, opinions and important updates from Kenya, Africa and around the World.
Copyright © 2021 Victor Mochere. All rights reserved.
Copyright © 2021 Victor Mochere. All rights reserved.
Hocam Flipboard’ın yeni yörengelerine uyumlumu? Lütfen bilgi verirmisiniz? Uyumlu değil ise, konuyu ve kodları güncelleyip bana bilgi verir misin?
Flipboard yönergeleri, WordPress RSS’sini etkileyecek şekilde değişmedi. Yukarıdaki kılavuz hala mükemmel çalışıyor.
Flipboard, RSS’nizi neden reddettiklerine dair size ayrıntılı bir neden verecektir.
Hello, should we add both codes? or just one of them
Or should we add both codes into the themes function php file?
thx.
No, just add one.