Best approach to change mobile background image and adding its class

As I am extending core/group block to add option for setting different image for smaller displays I used render_block_core/group filter to add style tag. I am already adding data-mobile-background-image to each group for its mobile view background image so there is no need for updating it through ID as suggested by Tom J Nowell. Final … Read more

Only show read more text when when wp:post-excerpt meets excerptLength

To override the behavior of the render_block_core_post_excerpt function in a Block Theme, especially to customize the “Read More” link behavior based on the excerptLength, you’ll need to unregister the original block and register your own customized version of it. This process involves a few steps: Deregister the Original Block: You need to deregister the original … Read more

How to check if a custom post type uses a custom template?

I mean “Full Width” like we do with pages : is_page_template( ‘Full Width’ ) ? is_page_template() does not accept a Template Name value like Full Width, but instead, a file name such as full-width.php or templates/full-width.php. Secondly, is_page_template() can be used with any post types and not just Pages (page post type), so you can … Read more