WordPress / twentytwentyfive

100 stars 70 forks source link

Posts without titles can not be reached from the list of blog posts #288

Open carolinan opened 5 days ago

carolinan commented 5 days ago

Description

It is possible to publish posts without titles. When a post without a title is listed in a query loop/post template, there must be a second link that leads to the blog post, otherwise, there is no way to open the single post.

This is commonly solved by linking the post date to the post. Some of the query loop patterns have both a post title and a date, but the date is not linked to the post.

Step-by-step reproduction instructions Create and publish a post without a title. Go to Site Editor > Templates. and open the Archive template. Open the settings sidebar and select the Template panel. In the design panel, select "Archive for the right aligned blog". Save.

View the archive page on the front. Try accessing the single post you just created.

Expected behavior

I expect to be able to open all posts from the list of blog posts.

These query loops need to be updated:

Blog posts for the right aligned blog

(multiple templates) This query has an excerpt, but no "continue reading" or "read more link". It has a featured image that is linked, but it does not help if the post has no featured image. It has a post date, but it is not linked.

News blog home

This template shows titles and categories. It has a featured image that is linked, but it does not help if the post has no featured image. I am not sure how to solve this one. Any new block with links would mean pretty drastic design changes. We may need to leave this one as is.

News blog with featured posts grid

This template shows titles and categories, and a date for one post. The date is not linked. It has a featured image that is linked, but it does not help if the post has no featured image.

News blog with sidebar

The main section has a post date, but it is not linked. It has a featured image that is linked, but it does not help if the post has no featured image.

The sidebar has post dates, but they are not linked.

There is a section above the footer, where neither the post title or date are linked, so the posts can never be reached from the list. It has a featured image that is linked, but it does not help if the post has no featured image.

carolinan commented 4 days ago

Having 3 links: title, date, and featured image, is not ideal at all, but in block themes there is no way to combine these links into one, or add them conditionally, which is the practice in classic themes. Perhaps in next year's theme we will be able to use proper clickable cards.

dballari commented 2 days ago

Hello, instead of linking the date I would use the single_post_title filter hook to compute a title whenever it's empty by adding there the first few words of the content. I do not know if this solution would be acceptable in a default theme.

carolinan commented 2 days ago

That or using the standard "No title" is common practice. But many people want to be able to decide if there should be a title or not, and filtering it would take that option away from them.