WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 8 months ago

#10984 new defect (bug)

If content uses the nextpage tag then only the first page is shown in feeds

Reported by: simonwheatley Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 2.8.4
Component: Feeds Keywords: has-patch
Focuses: Cc:

Description

If content uses the nextpage tag then only the first page is shown in feeds if the "full text" option is selected in "Settings > Reading > Show Full Text (in feed)".

No links are displayed to read the full content and no indication is given in the feed that it isn't the full content.

I think the behaviour should be to ignore pagination in feeds which are set to "full text".

I have attached a patch which alters the behaviour of the_content() so that if it is used in the context of a feed it concatenates the pages to form the full content and returns that.

Attachments (4)

full text for feeds.diff (972 bytes) - added by simonwheatley 5 years ago.
Amends the_content to return full content in a feed context
full text for feeds.2.diff (839 bytes) - added by simonwheatley 4 years ago.
Amended patch to use $post->content, rather than concantenating the $pages (which sometimes drags in unwanted content)
10984.diff (1.8 KB) - added by westi 4 years ago.
Alternative patch - add support for get_the_content ignoring pagination.
10984.1.diff (2.0 KB) - added by Latz 8 months ago.

Download all attachments as: .zip

Change History (29)

simonwheatley5 years ago

Amends the_content to return full content in a feed context

comment:1 scribu5 years ago

  • Milestone changed from Unassigned to 2.9

comment:2 follow-ups: westi5 years ago

I wonder if we should show a link to the full post if we detect next page instead maybe?

simonwheatley4 years ago

Amended patch to use $post->content, rather than concantenating the $pages (which sometimes drags in unwanted content)

comment:3 in reply to: ↑ 2 simonwheatley4 years ago

Replying to westi:

I wonder if we should show a link to the full post if we detect next page instead maybe?

The setting says "full text". Therefore we should (in my opinion) provide full text... if we did provide a link instead then the option wording should be amended.

comment:4 in reply to: ↑ 2 Denis-de-Bernardy4 years ago

Replying to westi:

I wonder if we should show a link to the full post if we detect next page instead maybe?

why not use more...?

comment:5 westi4 years ago

I don't think get_the_content should have feed specific behaviour in it.

I think it may be better to add an argument to get_the_content - which makes it ignore pagination in the post and return everything so that the behaviour is explicit on that and not done based on is_feed() - I can see that there maybe a use for this in other places by plugins.

westi4 years ago

Alternative patch - add support for get_the_content ignoring pagination.

comment:6 westi4 years ago

  • Keywords early added
  • Milestone changed from 2.9 to 3.0

Moved to early 3.0 for now.

I think this change is the correct behaviour but would like it to get more review and I don't think it is a blocker as 2.8 had the same behaviour.

comment:7 hakre4 years ago

Nice argumentation, but I for me this looks like while the paged posts feature was integrated, feeds were forgotten.

Bump to commit this now into the 3.0 trunk sothat it can actually get more review now.

comment:8 hakre4 years ago

Looks like we have no interest on this one getting committed. Close as wontfix?

comment:9 Denis-de-Bernardy4 years ago

I like neither patch. If I use a nextpage tag, I'd expect the RSS feed to output a More... link to page 2.

comment:10 follow-up: dd324 years ago

  • Keywords 2nd-opinion added

I think it should work as outlined above, The full text should be displayed.

Pagination of the post is used to seperate pages of the post, The feed is designed to display that post.

I would expect the feed content to display something like:

..Title..
Page 1 of 3
Page1 Content ..

Page 2 of 3
Page2 Content ..

Page 3 of 3
Page3 Content ..

comment:11 in reply to: ↑ 10 ; follow-up: simonwheatley4 years ago

Replying to hakre:

Looks like we have no interest on this one getting committed. Close as wontfix?

Ahem. I'm still interested, sorry for the silence. :)

Replying to Denis-de-Bernardy:

I like neither patch. If I use a nextpage tag, I'd expect the RSS feed to output a More... link to page 2.

I don't like this from a UX and publisher intent point of view. Feeds are about syndicating content not drawing people back into the site (no matter how much some publishers might want that); if you want to draw people back into the site then don't show full content in your feeds.

Replying to dd32:

I think it should work as outlined above, The full text should be displayed.

Pagination of the post is used to seperate pages of the post, The feed is designed to display that post.

I would expect the feed content to display something like:

..Title..
Page 1 of 3
Page1 Content ..

Page 2 of 3
Page2 Content ..

Page 3 of 3
Page3 Content ..

I feel this is diluting the content in the feed without adding significant advantage. I prefer showing the whole post (if show full text in feed is selected).

comment:12 in reply to: ↑ 11 Denis-de-Bernardy4 years ago

Replying to simonwheatley:

Replying to Denis-de-Bernardy:

> > I like neither patch. If I use a nextpage tag, I'd expect the RSS feed to output a More... link to page 2.
>
> I don't like this from a UX and publisher intent point of view. Feeds are about syndicating content not drawing people back into the site (no matter how much some publishers might want that); if you want to draw people back into the site then don't show full content in your feeds.

but in this case, don't use the nextpage tag either. its only point lies in getting more page views to display more ads.

imo we should add a more... link and that's it.

comment:13 follow-up: dd324 years ago

  • Milestone changed from 3.0 to 3.1

This isnt a regression from a previous release, I'm moving to 3.1 because of that. We can decide a clear resolution then.

Personally, i'm leaning towards just displaying the entire page, full well knowing that theres a filter so people can achieve the current result easily.

comment:14 in reply to: ↑ 13 valendesigns4 years ago

  • Cc valendesigns added
  • Version changed from 2.8.4 to 2.9.2

Replying to dd32:

This isnt a regression from a previous release, I'm moving to 3.1 because of that. We can decide a clear resolution then.

Personally, i'm leaning towards just displaying the entire page, full well knowing that theres a filter so people can achieve the current result easily.

Is there a filter you can add to the functions.php that would show the full content if your viewing a feed?

comment:15 follow-up: dd324 years ago

  • Version changed from 2.9.2 to 2.8.4

Is there a filter you can add to the functions.php that would show the full content if your viewing a feed?

There isnt a filter, But you could certainly do it with sub-10 lines of code i'd expect. I dont have a example handy however, or time to test it.

Please leave the version at whatever it was first reported at/first known at, It makes it easier to track when bugs were introduced.

comment:16 valendesigns4 years ago

Sorry, I will leave the version alone.

What do you mean by "sub-10"? Are you saying that it can't be done from the functions.php and you have to hack the core? I'm confused with that response. Thank you for being so quick with a reply though.

comment:17 follow-up: nacin4 years ago

No, not hacking core... < 10 lines in a plugin (or functions.php) to implement this.

comment:18 in reply to: ↑ 17 valendesigns4 years ago

Replying to nacin:

No, not hacking core... < 10 lines in a plugin (or functions.php) to implement this.

Is there any way you might help make that happen?

comment:19 in reply to: ↑ 15 ; follow-up: simonwheatley4 years ago

Replying to dd32:

Is there a filter you can add to the functions.php that would show the full content if your viewing a feed?

There isnt a filter, But you could certainly do it with sub-10 lines of code i'd expect. I dont have a example handy however, or time to test it.

This works for me:

<?php
/*
Plugin Name: Full Text Feeds
Plugin URI: http://simonwheatley.co.uk/wordpress/full-text-feeds
Description: Fixes a bug in WP's feeds whereby they are only served with the first page.
Version: 1.1
Author: Simon Wheatley
Author URI: http://simonwheatley.co.uk/
*/

function ftf_full_text_for_feeds( $content ) {
	if ( ! is_feed() )
		return $content;
	global $post;
	$content = $post->post_content;
	return $content;
}

add_filter( 'the_content', 'ftf_full_text_for_feeds', -100 );

?>

comment:20 in reply to: ↑ 19 valendesigns4 years ago

Replying to simonwheatley:

Replying to dd32:

Is there a filter you can add to the functions.php that would show the full content if your viewing a feed?

There isnt a filter, But you could certainly do it with sub-10 lines of code i'd expect. I dont have a example handy however, or time to test it.

This works for me:

Unfortunately, that plugin does not seem to work for me.

comment:21 valendesigns4 years ago

Never mind, that plugin works perfect. the only issue is that other plugins are applying/adding their own filters to 'the_content' and so I made the -100 even lower and got it working. Thanks for the help!!!

comment:22 nacin3 years ago

  • Milestone changed from Awaiting Triage to Future Release

comment:23 mdgl20 months ago

This bug seems to be languishing because of disagreements on the best way to fix the problem.

I suggest this issue is quite important, however as it may lead to data loss. People may be relying on syndicated feeds as a way of copying information around. Presently, multi-page posts are effectively destroyed when included in feeds, with no indication of the data loss whatsoever!

I vote that we increase the priority of this a bit and get something committed soon.

Regarding the last comment from Denis-de-Bernardy (comment:12), like the other respondents I believe that if the user has requested full content in feeds, that's what we should provide and not just some link to see the remainder of the content.

In my opinion, westi's approach to the fix is the most elegant and should be taken, although the patch needs a little update for 3.4.1. Since #12651 [3.0] there is no issue with using the 'pages' array as suggested by simonwheatley and this seems preferable to leaving the '<!--nextpage-->' comments within the content.

There is a minor issue with simonwheatley's plugin example (comment:19) as this will not respect posts protected with a password. Personally, I use a filter on 'the_content_feed' and check the 'multipage' global (and for a post password!) before resurrecting the missing content.

A more general point is that our whole handling of "the content" is starting to get rather complex and unwieldy with far too many things happening in filters and all over the place - one for another day perhaps!

comment:24 Latz8 months ago

This ticket seems to be a bit forgotten so I updated it to be patchable with v3.6.

Additionally: WordPress puts the_excerpt() in the description of the item if there is no explicit excerpt given by the user. Fixed that.

Latz8 months ago

comment:25 Latz8 months ago

  • Keywords 2nd-opinion early removed
Note: See TracTickets for help on using tickets.