Plugin Author
Ajay
(@ajay)
I haven’t touched the block. What is the error that you get when you insert the block? I don’t see issues with my test install
And, what are the settings of your block?
-
This reply was modified 3 years, 1 month ago by Ajay.
Thread Starter
fwmone
(@fwmone)
Thanks for your fast reply.
I don’t get any error. Instead, it shows “This block will be shown empty” (roughly translated from German). The “related-posts” renderer returns HTTP 200 ‘rendered: “”‘.
These are my settings: https://ibb.co/mRZMQXt
Thread Starter
fwmone
(@fwmone)
P. S. I found the problem. It’s in main-query.php:
if ( crp_exclude_on( $post ) ) {
return ''; // Exit without adding related posts.
}
…because…
// If the DO NOT DISPLAY meta field is set.
$crp_post_meta = get_post_meta( $post->ID, 'crp_post_meta', true );
if ( isset( $crp_post_meta['crp_disable_here'] ) ) {
$crp_disable_here = $crp_post_meta['crp_disable_here'];
} else {
$crp_disable_here = 0;
}
if ( $crp_disable_here ) {
return true;
}
I disabled showing CRP automatically at the end of this specific page because otherwise the block makes no sense – I would get two blocks instead (the one I included manually and the other that would be added at the end of the page). Up to 3.0.5, this worked.
-
This reply was modified 3 years, 1 month ago by fwmone.
-
This reply was modified 3 years, 1 month ago by fwmone.
Thread Starter
fwmone
(@fwmone)
As a temporary solution, I commented out
// Check exclusions.
if ( crp_exclude_on( $post ) ) {
return ''; // Exit without adding related posts.
}
in main-query.php. This seems to bring back how it worked before 3.0.6.
Plugin Author
Ajay
(@ajay)
Instead of the above, will you be able to make this change to the exclusions.php file to add these checks
// If the DO NOT DISPLAY meta field is set.
if ( ! $args['is_shortcode'] && ! $args['is_manual'] && ! $args['is_block'] ) {
$crp_post_meta = get_post_meta( $post->ID, 'crp_post_meta', true );
if ( isset( $crp_post_meta['crp_disable_here'] ) ) {
$crp_disable_here = $crp_post_meta['crp_disable_here'];
} else {
$crp_disable_here = 0;
}
if ( $crp_disable_here ) {
return true;
}
}
-
This reply was modified 3 years, 1 month ago by Ajay.
Thread Starter
fwmone
(@fwmone)
Thanks for your reply. For this to work, you also have to make this change in main-query.php…
// Check exclusions.
if ( crp_exclude_on( $post, $args) ) {
return ''; // Exit without adding related posts.
}
(add args argument to function call)
Plugin Author
Ajay
(@ajay)
Thank you @fwmone
I’ll get that fixed as well and push an update shortly. Sorry for the confusion.
I’m working on fixing that asap
-
This reply was modified 3 years, 1 month ago by Ajay.
Thread Starter
fwmone
(@fwmone)
Yes, I tested it in my environment thoroughly and it worked well.
Plugin Author
Ajay
(@ajay)
@fwmone
I’ve been able to replicate this – also added the checks for another use of the crp_exclude_on function. Will push an update shortly.
Plugin Author
Ajay
(@ajay)
@fwmone @clsklvr
v3.0.7 has been released which fixes this. Once again, apologies for breaking this feature.
Thread Starter
fwmone
(@fwmone)
Thanks a lot, tested it and it works well!
Plugin Author
Ajay
(@ajay)
Thanks both for confirming!