Tag: wordpress
Posts related to the WordPress CMS and using it for web development.
WPML Cover block ALT translation
In a follow up to – WPML: Translating blocks that aren’t translatable The ALT text in Cover block images was not translatable for me. Here’s the XML to add to the WMP->Settings->Custom XML Configuration panel to enable it. This makes both the ALT in the image tag and in the HTML comment translatable.
All Import Pro – ACF Image
Quick tip to import images into an Advanced Custom Fields image field. This is assuming the column in your spreadsheet is just the filename of the image, no URL. Step 1) Upload the images to your media library. Step 2) Note the full directory of an image, e.g. https://www.example.com/wp-content/uploads/2024/09/ Step 3) Install the All Import…
WordPress ACF block not rendering
I spent too much time trying to figure out why my ACF block was not rendering before taking a look in the build folder and seeing no PHP files. If you’re using the Interactivity API and the scripts in package.json that it generates, it may have left off –webpack-copy-php.
WPML: Translating the Site Logo
I’m assuming you’re using WordPress Full Site Editing and have a Site Logo in your default language template. This may work for older WordPress templates, but I haven’t tested. First step is to upload your new logo to the media library. Take note of the ID of the Logo in the media library. Hover over…
WPML: Translating blocks that aren’t translatable
A follow up to yesterday’s post: Getwid-Megamenu WPML I ran into an issue that the Previous & Next buttons in my single-post template were not translatable in WPML. The first step was to take a look at the HTML for the block from the editor: We can see that the text we want to translate…
WPML: Getwid-Megamenu
If you’re using getwid-megamenu (as of 2024-04-18) and WPML you’ll want to either add a wpml-config.xml file to your theme, or in WPML->Settings->Custom XML Configuration add this to make the main mega menu items translatable. This technique can be used for any block that isn’t already translatable. With all of the configuration options here: https://wpml.org/documentation/support/language-configuration-files/make-custom-gutenberg-blocks-translatable/
WordPress Custom Source Block Bindings with Block Variations
This is a follow up to my first block bindings post, and Brian Coords great YouTube video. Combining custom sources for block bindings with block variations can be a simple and powerful tool. Here’s a straightforward example on how they can be beneficial together. With a block theme in the past if you wanted the…
WordPress render_block filter to remove all links from post-terms
I just needed to remove all links from all post terms blocks (for reasons). The filter render_block_{$this->name} is such a great resource for modifying core blocks and made it so simple to do. If you’re doing any kind of work with blocks in WP as a dev, it pays to have this filter always at…
Using ACF with WordPress Block Bindings API
Update 2024-04-02: ACF supports Block Bindings directly now with acf/field Advanced Custom Fields (ACF) doesn’t have direct support for Block Bindings yet (as of 2024-03-14), but in the meantime, this seems to work by creating a custom source for block bindings: and then reference in a template (use the code editor): Reference: https://developer.wordpress.org/news/2024/03/06/introducing-block-bindings-part-2-working-with-custom-binding-sources/
WordPress content in Post Template not editable
With WordPress FSE, if you run into the issue of not being able to edit or insert content inside the Post Template block inside a Query Loop block. Try temporarily editing the query loop to not inherit and instead be a query that you know will show results. Then it should be editable. Make your…