Does a custom WordPress theme require updates to it’s source code?

Yes, a custom WordPress theme may require updates to its source code over time. As WordPress core updates and evolves, there may be changes that affect the functionality or compatibility of the theme. Additionally, if the theme uses any third-party libraries or plugins, updates to those dependencies may also require changes to the theme’s code. … Read more

How to set the margin on an innerBlock in a block variation?

If we create a paragraph and give it a margin of 2 ( default settings no custom scales or theme.json ) then we get this: <!– wp:paragraph {“style”:{“spacing”:{“margin”:{“top”:”var:preset|spacing|30″,”right”:”var:preset|spacing|30″,”bottom”:”var:preset|spacing|30″,”left”:”var:preset|spacing|30″}}}} –> <p style=”margin-top:var(–wp–preset–spacing–30);margin-right:var(–wp–preset–spacing–30);margin-bottom:var(–wp–preset–spacing–30);margin-left:var(–wp–preset–spacing–30)”>stuff</p> <!– /wp:paragraph –> It sounds reasonable to extract var(–wp–preset–spacing–30) from the style attribute but this wouldn’t be right, as that’s generated HTML. Instead we … Read more

How to make content as required in custom post type?

the content_save_pre filter. It checks the post type of the current post and ensures that the content field is not empty. If the content field is empty, the function calls wp_die() to display an error message and stop the post from being saved. Note: Make sure to replace “custom_post_type” with the actual name of your … Read more

Full site editing templates folder vs block-templates

After some more checking, I found the issue. The repo I was setting up, was a template that will be used by other sites, so I saved it in a folder called templates (Full path: /Users/bas/git/work/templates/wp). In the wp-includes/block-template-utils.php the name/slug of the template is decided with the following code. $template_slug = substr( $template_file, // … Read more

WordPress Two Level Filters on Getting Custom Taxonomy Terms

It doesn’t make any sense querying with get_terms when: genre=”action” AND quality = ‘HD’ The reason is: The only term that has taxonomy genre equals to action, is action. And the only term that has taxonomy quality equals to HD, is HD. If you constrain them with AND, then basically you have nothing. Since there’s … Read more