Open bobbingwide opened 3 years ago
I think you have faulty expectations of how the more tag works. Core WP returns the correct amount of content according to the more tag's options and the page that is requested. The more tag is rendered only on archive requests of full content posts. So your test case should not show any more tags, since it's on a Page.
So your test case should not show any more tags, since it's on a page.
My expected result ( 3rd screen shot ) does not show a more tag for the Post content column. I expect the full content of the post ( Zzz ) to be displayed.
The first screen shot shows the More tag I don't want to see and doesn't display the content after the more tag.
With regards to the Post Excerpt. Here I do expect the more tag to be displayed on the front end. Additionally I expect HTML tags in the excerpt to be respected, not stripped.
The first screen shot shows the More tag I don't want to see and doesn't display the content after the more tag.
This is how more tags work, but it shouldn't actually be showing because it's not an archive page (although the query might be considered an archive query).
With regards to the Post Excerpt. Here I do expect the more tag to be displayed on the front end.
The more tag has nothing to do with the excerpt. The more tag is only rendered when showing full content on an archive page.
Additionally I expect HTML tags in the excerpt to be respected, not stripped.
If you write a manual excerpt, the HTML won't be stripped. HTML tags are stripped when generating automatic excerpts.
@joyously There's a subtle difference between "What do I expect" and "What do I want". I've been using a shortcode that I wrote for longer than I can remember.
This is the output using the following shortcode
[bw_table post_type=post numberposts=1 orderby=title order=desc fields=title,content,excerpt]
to create the equivalent of what I expected.
Being so used to this sort of output I expected to get the same results from core/post-content
and core/post-excerpt
.
So, I'll rephrase this as "What I want" or "What I would like to have happen".
core/query-loop
on the front end, to be able to display the full content before and after the More.core/query-loop
on the front end, to display a nicely formatted excerpt.I believe these are reasonable requirements.
It would appear to me that the core/post-excerpt
block, as currently implemented, neither satisfies this requirement nor delivers what it promises with regard to the Show link on new line toggle.
P.S. I've just discovered that updating the post excerpt of one post while it's being viewed from another actually updates the excerpt. Wacky.
Hi @bobbingwide, I am working on the post excerpt block, are there any actionable items left in this issue?
The post excerpt block does not use the more tag. It has a placeholder text for the read more link, and if this placeholder text is not replaced, it does not output a read more link text. -The block can not show a link on a new line if there is no link.
It also does not prevent other content from showing. If you have a post template or post query that uses the content block, and you add the post excerpt block in the block editor, it will show a custom or automated excerpt, but if there are other blocks in the post, those will also show.
Hi Carolina, I restated my requirements in my most recent comment ( November ).
How I envisage the Excerpt being created automatically, when there isn't a hand written one, is that it would be the content prior to the more tag.
This is the excerpt. It may have <b>HTML</b> and all sorts of other stuff such as links, images, fancy blocks doing wierd things and dare I say it, inline shortcodes.
<!-- more -->
This is the rest of the content.
In my shortcodes, when extracting the excerpt, my code respected the HTML, images etc. I had an option to display the "read more" link after the excerpt.
When I displayed the full content, then there was no reason to display a read more link.
One use case would be a grid of 3 posts of post type "block", displaying the block's SVG first followed by the block's description, then, a read more button.
Another use case is demonstrated here: https://blocks.wp-a2z.org/oik-plugins/gutenberg/?oik-tab=blocks
These are variations of excerpt that aren't currently catered for by WordPress core.
Perhaps there should be a variation called Teaser.
I added the code in the following attachment to get this to work the way I expect.
If the 'read-more' tag is used it will leave images in and display everything up to the "read-more" (followed by a link to read more) otherwise it will return the excerpt followed by a read-more link. It would be good if this could be done directly with the Post Excerpt block instead of requiring the need to add the filter.
Describe the bug When the post-content and post-excerpt blocks are displayed in the post-content of a post displayed in a query block the output doesn't match expectations, neither in the editor nor the front end.
To reproduce Steps to reproduce the behavior:
The content of the post with the highest title ( Zzz ) is
The content of page Aaf is
Expected behavior
For the display of the post created in Step 1.
Further notes regarding the post excerpt.
In my opinion the logic to display the post excerpt should be the same as the logic to display the post content. The word limit should only be applied when the post excerpt has not been explicitely defined, either by the More block or by it being manually created.
Post excerpt processing should include:
Screenshots Here's the result where page Aaf uses a query to display the last post in two columns with Post content on the left and Post excerpt on the right. The Post content looks more like that which I'd expect the Post excerpt should look. The Post excerpt should display the more link.
In the block editor the display is more confusing.
Expected result - front end - Post content
Editor version (please complete the following information):
Desktop (please complete the following information):
Additional context
In order to get the expected result on the front end for the Post content I found that I needed to change the core function
get_the_content()
( wp-includes\post-template.php ) adding one line of codeI haven't checked to see if there's a WordPress TRAC.