WordPress.org

Make WordPress Core

Opened 7 months ago

Closed 6 months ago

Last modified 6 months ago

#25330 closed defect (bug) (wontfix)

Twenty Fourteen: Filter the home page posts and remove post formatted posts that are visible in the ephemera widgets

Reported by: iamtakashi Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.8
Component: Bundled Theme Keywords:
Focuses: Cc:

Description

Currently, the last two formatted posts are removed from the main query because of the legacy from Further theme. We need to remove formatted posts dynamically by checking the ephemera widgets.

Related: #25028

Attachments (2)

25330.patch (3.5 KB) - added by Frank Klein 7 months ago.
This is a first stab at a patch. I'm not sure if this is the most clever way of doing it, so any feedback is appreciated.
25330.2.patch (3.5 KB) - added by Frank Klein 7 months ago.

Download all attachments as: .zip

Change History (15)

Frank Klein7 months ago

This is a first stab at a patch. I'm not sure if this is the most clever way of doing it, so any feedback is appreciated.

comment:1 Frank Klein7 months ago

  • Cc contact@… added
  • Keywords has-patch needs-testing added

comment:2 obenland7 months ago

  • Milestone changed from Awaiting Review to 3.8

Frank Klein7 months ago

comment:3 Frank Klein7 months ago

  • Cc contact@… removed

Updated patch with the following modifications:

  • Use get_posts() instead of a WP_Query
  • Make sure the IDs to exclude are unique via array_unique()
  • Add documentation
  • Formatting fixes

comment:4 Frank Klein7 months ago

  • Cc contact@… added

comment:5 lancewillett7 months ago

Is this tested and ready for commit?

comment:6 kraftbj7 months ago

The code works great.

A philosophical question though: Is the point to remove only the post-formatted posts actually visible on the page from the main stream, while leaving in older post-formatted posts that had "fallen off" the widget?

Using this on my site currently, I'd expect the main stream not to show the post-formatted posts if the widget for that post format exists at all.

What about changing up the function to, instead of excluding specific post IDs that are on display, we add a $query->set based on the formats present using the NOT IN operator, which would exclude all posts of a specific format if displays via the widget?

comment:7 kraftbj7 months ago

  • Cc bk@… added

comment:8 lancewillett6 months ago

#25519 was marked as a duplicate.

comment:9 lancewillett6 months ago

Discussing in today's office hours, we'd prefer to keep the functionality as proposed originally:

iamtakashi: I don't understand why we should remove formatted posts that are not visible in the widget.
obenland: I don't like it. They'd end up only be accessible through archive pages

Let's work with the .2 patch and keep testing.

comment:10 follow-up: kraftbj6 months ago

My last pitch for a possible change in thought, using myself as the test case.

On http://bjk.staging.wpengine.com currently (at r25639 with .2 patch applied), I took a stream of image posts in one day. The latest one is in the widget, which happens to be at the bottom of the right sidebar.

The first two posts in the "main" area are the 2nd and 3rd most recent image format posts. It seems wonky to me that the most recent image would be in the sidebar, relatively buried by choice, while the older image formatted posts are in the main stream, more prominent in this case.

For my purposes, I want the main stream to be only the content formats that isn't relegated to the widgets. My longform posts are the highlight of the blog (as was before this patch, currently up at http://www.brandonkraft.com/), while my photoblog, random asides, etc are at /type/images, /type/asides, etc.

If I wanted the format to be part of the main stream, I wouldn't have limited it to display only the most recent in the widget. Or, at least taking the original functionality more into account, the most recent image in the sidebar while older content of the same format is promoted in a higher place potentially.

My final pitch. :-)

comment:11 in reply to: ↑ 10 obenland6 months ago

Replying to kraftbj:

My last pitch for a possible change in thought, using myself as the test case.
...
My final pitch. :-)

Never stop fighting!


I think I was a bit too quick in my reaction. We narrow the results only down when we are on the front page, not on any subsequent page. I think does kind of make sense take all posts of that format out, to avoid showing older posts of the same format more prominently than newer posts.

Having said that, the purpose of the widget is to bring formatted posts to the reader's attention that would otherwise be hidden in subsequent pages. One could also argue to not remove the posts in the first place.

comment:12 lancewillett6 months ago

  • Keywords has-patch needs-testing removed
  • Milestone 3.8 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Closed with the changes in r25762, see #25565.

comment:13 lancewillett6 months ago

In 25814:

Twenty Fourteen: cleanup, props iamtakashi. Fixes #25613.

  • With the ephemera widget in place, content-recent-formatted-post.php is unused, see #25028.
  • We're no longe filtering formatted posts from the main query, see #25330.
    • Fix a typo.
Note: See TracTickets for help on using tickets.