Open bobbingwide opened 3 years ago
While trying to create a simple test for the problem I accidentally moved a block from a dynamically displayed post out of the Post content block. This shouldn't be possible. Here the WordPress block came from the post entitled WordPress. I was trying to move the Post content block into the first column.
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.
The content of page Aaf is
<!-- wp:paragraph -->
<p>aaf's post excerpt before more.</p>
<!-- /wp:paragraph -->
<!-- wp:query {"queryId":1,"query":{"perPage":1,"pages":1,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"title","author":"","search":"","exclude":[1346],"sticky":""},"className":"border"} -->
<!-- wp:query-loop -->
<!-- wp:post-title {"isLink":true} /-->
<!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column -->
<div class="wp-block-column"><!-- wp:heading {"level":3} -->
<h3>Post content</h3>
<!-- /wp:heading -->
<!-- wp:post-content /--></div>
<!-- /wp:column -->
<!-- wp:column -->
<div class="wp-block-column"><!-- wp:heading {"level":3} -->
<h3>Post excerpt</h3>
<!-- /wp:heading -->
<!-- wp:post-excerpt {"wordCount":43,"showMoreOnNewLine":false} /--></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->
<!-- /wp:query-loop -->
<!-- /wp:query -->
<!-- wp:more -->
<!--more-->
<!-- /wp:more -->
<!-- wp:paragraph -->
<p>aaf's post content after more.</p>
<!-- /wp:paragraph -->
The content of the post with the highest title ( Zzz ) is
<!-- wp:paragraph -->
<p>Zzz - post excerpt before more.</p>
<!-- /wp:paragraph -->
<!-- wp:separator -->
<hr class="wp-block-separator"/>
<!-- /wp:separator -->
<!-- wp:more -->
<!--more-->
<!-- /wp:more -->
<!-- wp:paragraph -->
<p>Zzz - start of post content after more. </p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>This post was created to test post content & post excerpt extraction for the <code>core/post-content</code> and <code>core/post-excerpt</code> blocks when they're inner blocks of the <code>core/query</code> <code>core/query-loop</code> constructs. </p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>See <a href="https://s.b/wp56/aaf/">page Aaf</a>.</p>
<!-- /wp:paragraph -->
The More block should not be a problem
Should be processed the same as on the front end. That may involve:
post_excerpt
field, if setor
I've been retesting this using the original data for #27 and I'm still getting strange results.
The content of post B is
<!-- wp:paragraph -->
<p>B's normal excerpt</p>
<!-- /wp:paragraph -->
<!-- wp:more -->
<!--more-->
<!-- /wp:more -->
<!-- wp:paragraph -->
<p> [bw_wpadmin]</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>B's normal content</p>
<!-- /wp:paragraph -->
When displaying the post excerpt for B I'd expect to see "B's normal excerpt" For the post content I'd expect to see all of the above.
What I'm actually getting is just the post content, there's no post excerpt.
<div class="entry-content wp-block-post-content is-layout-flow">
<p>B’s normal excerpt</p>
<p> <a href="https://s.b/wp55/tt1/b/#more-92" class="more-link"><span aria-label="Continue reading B">(more…)</span></a></p>
</div>
Perhaps it's my understanding of what the more block is supposed to do! When there isn't a more block it seems OK. I'll have to check the query loop again.
I'll have to check the query loop again.
OK, the reason we don't see post excerpt is because it's not included in the post-template.
I should be attempting to reproduce the problem with page Aaf and post Zzz. ... and then understand / believe that what I got told in Nov 2020 is that what I'm seeing is what was intended!
Environment now is s.b/wp
URL: https://s.b/wp/aaf/
When there isn't a more block in Zzz then the post content and post excerpt are displayed the same on the front end.
When there's a hand cranked excerpt then we see the hand cranked excerpt.
When there's a more block then the post content is truncated at the more.
When the more block "Hide the excerpt on the full content page" is toggled on then
These were the results testing with WordPress 6.0.1 and Gutenberg 12.3.0 I'd better repeat the tests with the latest versions: WordPress 6.2-RC1 and Gutenberg 15.3.1
With WordPress 6.2-RC1 and Gutenberg 15.3.1 the results are different.
DIFFERENT When there isn't a more block in Zzz then the post content and post excerpt contain the same data but the excerpt has lost all the HTML formatting.
SAME When there's a hand cranked excerpt we see the hand cranked excerpt
SAME When there's a more block then the post content is truncated at the more. See the first screen capture in https://github.com/bobbingwide/fizzie/issues/43#issuecomment-732448795
When the more block "Hide the excerpt on the full content page" is toggled on then
The Expected result - front end that I documented on 23 Nov 2020 at 10:54 pm reflects the results I used to get using the [bw_pages] shortcode displaying post_content (C) or post_excerpt (E).
https://github.com/bobbingwide/fizzie/issues/43#issuecomment-732473209
I've reproduced the Expected result - front end with the page Aaf 2023. This page uses the [bw_field] shortcode to display post_content and post_excerpt directly from the post's fields. These have the green background. Below these are the output of the blocks.
Note that what's displayed for the post content block is different in the editor.
What I see in the editor is what I want in the front end!
I suppose I could override the behaviour of the post-content
and post-excerpt
blocks to achieve this. I won't close this issue yet.
Well, the
post-content
block appeared more like an excerpt than post content. In order to fix this I had to change the core functionget_the_content()
to set$elements['more']
to true, sincegenerate_postdata()
hadn't.Not surprisingly this didn't resolve the problem with the
post-excerpt
ignoring themore
block.Originally posted by @bobbingwide in https://github.com/bobbingwide/fizzie/issues/27#issuecomment-725721976
Problem
core/post-content
when nested in a query in another post's query-loop'score/post-content
block is broken by a more block.While developing my fix for the
post-content
infinite recursion problem, I became aware of a problem with the display of post content in the nested posts. The workaround I implemented for #27 was to eliminate the more block from the content that was being displayed.In the above screen capture I've re-introduced the
core/more
block into the Aab page.The post content should be 'Aab - excerpt before more. Aab - post content after more.' The More link shouldn't appear.