Hot answers tagged

11

You want to use paged not page in the request and it should work. You can find more information about WordPress pagination paged parameter here.


11

Here is a great example. How to display featured post thumbnails in WordPress feeds paste this code snippet in your theme functions.php file // display featured post thumbnails in WordPress feeds function wcs_post_thumbnails_in_feeds( $content ) { global $post; if( has_post_thumbnail( $post->ID ) ) { $content = '<p>' . ...


9

You could do it by adding an action to the hook 'rss2_item' like so: add_action('rss2_item', function(){ global $post; $output = ''; $thumbnail_ID = get_post_thumbnail_id( $post->ID ); $thumbnail = wp_get_attachment_image_src($thumbnail_ID, 'thumbnail'); $output .= '<post-thumbnail>'; $output .= '<url>'. $thumbnail[0] .'</...


8

Without knowing what your post_gallery filter function does, there's no way to give a proper answer. However, if you are using the post_gallery filter, and returning new markup, then yes, it will be used in feeds too. The code you mention commenting out happens after the post_gallery filter, and won't get executed at all if you're returning a different ...


8

You should be able to use pre_get_posts and set the posts_per_page to 50 conditionally (on being feed for categories). Unfortunately there is this unresolved trac ticket. The only work-around is to do hook into post_limits and replace the LIMIT part of the SQL query directly. add_action('post_limits','wpse71759_category_rss_limit',10,2); function ...


7

According to the Codex, fetch_feed() uses the SimplePie engine for parsing RSS. So, if $item->get_title(); is working, then you should be able to do: $item->get_thumbnail(); as per the SimplePie documentation, as long as there are any thumbnails already on the feed. UPDATE: Before running the above, you have to insert the images on your feed. ...


7

THANK YOU THANK YOU for this excellent piece of information. I wanted to extend what the other two have written already... For this to validate, you must have a custom namespace. Here's how you do that: /* IN ORDER TO VALIDATE you must add namespace */ add_action('rss2_ns', 'my_rss2_ns'); function my_rss2_ns(){ echo 'xmlns:mycustomfields="'. ...


7

This is a really cool idea. I don't think part 2 should be handled inside WordPress: there are plenty of RSS to email providers. They're going to be way better at that than a plugin (or theme) is likely to be. BUT we can create RSS feeds. Step one: set up a class to wrap everything up. There are a few class constants and variables here -- we'll use them ...


7

Based on the notes here and many other resources I read, I came up with this solution specifically to work with Mailchimp RSS to Email converter with the feed from Wordpress. Their templates use the <media:content> extension to the item element to populate their image macro. This code goes in the functions.php of the theme. // Add namespace for media:...


7

First set the post type to display on main feed page i.e. /feed using pre_get_posts hook $q->set('post_type', array('post', 'page')); On individual page WordPress shows comment feed then set it to false and display page content in feed. $q->is_comment_feed = false; In feed template WordPress calls the_excerpt_rss() which calls get_the_excerpt() so ...


6

Copy /wp-includes/feed-rss2.php to your theme folder Edit it and make whatever changes you desire (e.g. removing the line for dc:creator) in your theme's functions.php file, add the following function: remove_all_actions( 'do_feed_rss2' ); function create_my_custom_feed() { load_template( TEMPLATEPATH . '/feed-rss2.php'); } add_action('...


6

http://www.example.com/category/cat1,cat2/feed will include posts belonging to cat1 OR cat2, while http://www.example.com/category/cat1/category/cat2/feed will include posts belonging to both cat1 AND cat2 simultaneously. See the update below! In the following example, the first RSS will include all posts, while the second – Post 3 and Post 4 only. ...


5

I was going to use the above answer from Otto but the more I looked at the templates the more it dawned on me that you don't need all that. Just hook the_author filter and check is_feed if you want a RSS specific author. function f_the_author( $display_name ) { // $display_name === string $authordata->display_name if ( is_feed() ) { ...


5

Here is a list of points that will help you in order to make an iOS app for your WordPress blog: You can either parse XML in the RSS feed, JSON by installing a JSON plugin in your WordPress or you can also parse HTML directly. 1) I would suggest using NSXMLParser and parse the RSS feed instead of using JSON. Reason being, if something goes wrong to the ...


5

PHP files in the wp-includes directory should not be accessible from the outside, they should only be included by wordpress code. Therefor an easy fix to this is to use .htaccess rules to block access to *.php files that are under the wp-includes directory


5

Atom vs RSS2 Let's look at the wp-includes/feed-atom.php and wp-includes/feed-rss2.php files. The updated element of the Atom feed entry is: <updated><?php echo mysql2date( 'Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false ); ?></updated> The pubDate element of the RSS2 feed item is: <pubDate&...


5

Here's how we can use the builtin public query parameters on feeds: Query parameter: s We can use the s query parameter on the feed: https://example.com/feed/?s=KEYWORD This will generate a feed for the keyword on all searchable post types. Query parameter: post_type We can restrict it to a given post type with: https://example.com/feed/?s=KEYWORD&...


4

My approach would be to: On the Reading Options page, set the For each article in a feed, show... option to Full Text so that, by default, feeds will include the entire post. Pass a custom URL parameter to each individual feed when you want the excerpt instead of the full text. e.g., http://example.com/author/username/feed?format=excerpt. Make sure you don'...


4

The RSS2 feed is generated in the wp-includes/feed-rss2.php file. In this file, there is an action hook named rss2_item. You can use this action hook to add tags to each item in your feed. There is a codex article on rss2_item with examples, including this one for adding an <image> tag: <?php add_action('rss2_item', 'add_my_rss_node'); function ...


4

Feeds are not stored, WordPress generate them on request. That means that even if WordPress can generate 4 type of feed, that does not affect in any way performance, but gives the possibility to users to choose a format they like according to reader they are using: is not WordPress fault if there are different types of feed standard. The WordPress preferred ...


4

Alright kids, we're gonna leverage a couple of awesome WordPress features today. First things first, let's get that custom feed registered with add_feed: /** * Register "my_feed". */ function wpse_226681_register_feed() { // do_feed_rss() loads the default RSS template in WordPress add_feed( 'my_feed', 'do_feed_rss' ); } add_action( 'init', '...


4

This may not be ideal, but it is a beginning. First make sure that the full content is in the feed: function fullcontentfeed($content) { global $post; $content = $post->post_content; return $content; } add_filter('the_excerpt_rss', 'fullcontentfeed'); You should then see the full feed at this url http://swissaudio.com/craftsmanship/feed/...


3

Plugin Here's a tiny plugin that allows you to override the Full-Text/Summary feed option, through a simple GET parameter: <?php /** * Plugin Name: Feeds with Summary Or Full Text * Description: GET parameter _summary with values yes or no * Plugin URI: http://wordpress.stackexchange.com/a/195197/26350 */ add_action( 'rss_tag_pre', function( $tag )...


3

I do this using the regular WordPress Category Feeds and MailChimp to provide my email subscribers the option of receiving new posts only for categories they're interested in receiving. Within MailChimp, you create a Group for each WordPress category and then on your email subscription form you allow your subscribers to select the groups (i.e., categories) ...


3

If you want to be able to see which of your visitors have subscribed in GA, you need to call an event, a virtual page or a custom variable using an onclick event. Probably best to use an event, so add something like this to the link: <a href="subscribe link" onclick="_gaq.push(['_trackEvent', 'Subscribe', 'RSS', document.location.pathname]);">...


3

If you ever need to just update a single feed RIGHT NOW, for example, to reflect changes made in site settings or a plugin, all you have to do is update any of the posts that appear in the feed. The reason for this is that WordPress, I conjecture, when serving up a feed, checks all the posts in the feed, and if none of them have been updated since the feed ...


3

I'm not sure this is a problem you really need to solve. Any regular Chrome user knows this is how Chrome (doesn't) handle RSS. That said, you can provide a custom feed template. see Customizing Your Feeds in Codex.


3

Here's a suggestion: First we target the RSS widgets that have summaries. Then we filter the output of wp_trim_words() within the wp_widget_rss_output() function, to remove the [&hellip;] part. Then we clean up in two ways: First we remove our wp_trim_words() filter, if it's running, before the current widget is displayed. We can do that by hooking ...


3

wp_get_update_data() collects and returns number of updates available for plugins, themes and WordPress core. It's used in Admin Bar and admin update menus.


Only top voted, non community-wiki answers of a minimum length are eligible