开发者 | tjtaylor |
---|---|
更新时间 | 2021年3月21日 23:09 |
捐献地址: | 去捐款 |
PHP版本: | 2.8 及以上 |
WordPress版本: | 5.7 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
[wp_rss_retriever url="http://feeds.feedburner.com/TechCrunch/" items="10" excerpt="50" read_more="true" credits="true" new_window="true" thumbnail="200" cache="12 hours"]
Live Demo:
http://demo.thememason.com/rss/
Features:
wp-rss-retriever.zip
to the /wp-content/plugins/
directoryThis could be because the source you're fetching from does not include the featured image in their RSS feed. There is nothing you can do to fix this unless you have control of the source website. If so, you can simply install this plugin on the source website and it will include the featured images within the RSS feed automatically.
This is due to the source website including a low resolution image in their feed. There is nothing you can do to fix this unless you have control of the source website. If so, you can simply install this plugin on the source website and it will include larger featured images within the RSS feed automatically.
You can change the layout via WordPress filters. Add the following code to your themes functions.php file:
function custom_rss_layout_callback( $layout ) {
$layout = array(
'thumbnail',
'title',
'content',
'postdata',
);
return $layout;
}
add_filter( 'wp_rss_retriever_layout', 'custom_rss_layout_callback' );
In addition, you can add your own HTML to the output if you want to wrap elements. Example:
$layout = array(
'
',
'thumbnail',
'title',
'content',
'postdata',
''
);
Or, if you only want to display the title:
$layout = array(
'title',
);
Click on the "+" icon to add a new block. Search for "shortcode". Click on the shortcode block to add it. Copy and paste the example shortcode above into the block. Replace the url and other parameters as needed.
Copy and paste the example shortcode above into your content. Replace the url and other parameters as needed. Update/publish the page or post.
Create a new text widget. Click on the "Text" tab. Copy and paste the example shortcode above. Replace the url and other parameters as needed.
Here's an example of how to display an RSS feed with PHP