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

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:...


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

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

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() ) { ...


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

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

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 ...


4

You can select between Full text and Summary in the Reading settings: If you select the Summary, then a) To control the number of words in the feed summary you can use: add_filter('excerpt_length','custom_excerpt_length'); function custom_excerpt_length( $num_words ){ return 30; // number of words to show } The default number of words in the ...


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

As pointed out in the comments by @kaiser, your question is very similar to this question. In fact, the question itself holds the answer. To disable all feeds add the following code... function itsme_disable_feed() { wp_die( __( 'No feed available, please visit the <a href="'. esc_url( home_url( '/' ) ) .'">homepage</a>!' ) ); } add_action('...


4

You are trying to modify a built-in widget. Unfortunately for you there is no easy solution to get the results you desire. As you figured out already, there is no filter hook to modify the whole title output. How to get the results? Create your own Widget extending WP_Widget_RSS where you overwrite the parents method widget with your designated method. ...


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/...


4

Instead of proper format, it causes the problem in firefox. To fix the format, solve your problem. Read this article: Firefox tries to download my RSS feed RSS Feeds have a content type problem. Most people end up serving them with the content-type: text/XML. But this practice is frowned upon for several reasons. The main reason people don't like text/XML ...


3

You can create your own feeds in wordpress. Add this to functions.php: function my_customfeed() { load_template( TEMPLATEPATH . 'your-customfeed.php'); } add_action('do_feed_customfeed', 'my_customfeed', 10, 1); This will enable a new feed called customfeed. Now you can create your-customfeed.php in your theme directory for the new rss. To make things ...


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

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

If we look at the file /wp-includes/default-filters.php we can find these two lines in there add_action( 'wp_head', 'feed_links', 2 ); add_action( 'wp_head', 'feed_links_extra', 3 ); so if we want to remove these actions, we can do it with these two lines in functions.php: ...


3

If someone happens upon this and doesn't have the option to change the feed length, my solve was to use an array of feed pages: fetch_feed( array('http://example.com/feed/', 'http://example.com/feed/?paged=2', 'http://example.com/feed/?paged=3') );


3

You can escape the HTML, so instead of echo $item['link']; you would write: echo esc_html($item['link']); // This is a WP function //or echo htmlspecialchars($item['link']); //PHP equivalent Also important to note your code is depreciated, fetch_rss has been replaced by fetch_feed. http://codex.wordpress.org/Function_Reference/fetch_feed ps. You can ...


3

You can try to add geo_country as an extra query variable with: /** * Add the 'geo_country' as a public query variable * * @param array $query_vars * @return array $query_vars */ function my_query_vars( $query_vars ) { $query_vars[] = 'geo_country'; return $query_vars; } add_filter( 'query_vars', 'my_query_vars' ); and then setup a ...


3

Very, very quick unscientific research suggests that there is only one query_var set for the main feed. Other feeds such as category, tag, author feeds have more than one query_var. Thus the following should kill the main feed but leave others intact. add_filter( 'pre_get_posts', function($qry) { if ($qry->is_feed()) { $fvars = ...


3

I never used the theme "Opulus Sombre". But the feed link on the <head> section typically comes from the functions.php. There is a line saying1: add_theme_support( 'automatic-feed-links' ); Otherwise it can be hard-coded to your header.php like2: <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" ...


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