The ‘Check first block type’ function is exactly what I need (THANK YOU!), but how do I use it outside of a loop?
E.g., I want to show a different logo in my header if the first block isn’t a cover…
Im getting this error:
Notice: Trying to get property ‘post_content’ of non-object
This is for the 404 page and archive…
I tried adding ‘global $post;’ to the function.. I can’t get it working 😢
@dmchale Thank you for the code, but how do I use it?
If I want to get the authors name (ACF field) from my Testimonials block on page 2, would I use the following…? what is the selector?
get_field_from_block( $selector, 2, 'block-49b987a0-a081-4bf7-b7e0-5858d28c9c0a' );
any help is appreciated.
@micqey Thanks for the code – are you able to give an example of use?
How do you use this code?
I added it to my fuctions.php and changed the $fc_field and $fc_layout variables to match mine, but how do I use it in my index.php loop? Do I need to call the function? Nothing happens when I add it to my functions file.
I’m currently having to manually add an excerpt via the “except field”- <?php the_excerpt_max_charlength( 400 ); ?>
Any help appreciated.