I want to add the alt attribute to all the photos!

If your current code manages all blocks with images replacing usage wp_get_attachment_image_src with output of hardcoded img tag, with echo wp_get_attachment_image() which will return img tag as string with default alt of image or empty if non set will work. Below is your code updated with idea described. <?php class home_main_post_below_list extends AQ_Block { //set … Read more

500 error after upgrading from 5.0 to 5.4 and adding empty functions.php

I’ve managed to print the error message by adding the following to the functions.php: function exception_handler($exception) { echo “Uncaught exception: ” , $exception->getMessage(), “\n”; } set_exception_handler(‘exception_handler’); For some reason logs did not include the error details before. The error is call to undefined function is_blog_installed() which I have no idea why’s that. 😀

Accessing WordPress Functions get_permalink() in Vanilla PHP?

The developer’s reference is a great place to start. You’ll find get_permalink in wp-includes/link-template.php. You might want to look into wp-cli wp post list –post__in=1 –field=url should do the trick as discussed in wp-cli issue#2727 Also, there’s the rest-api to consider. The best solution for getting the permalink might be to just post/cURL a request … Read more

Get term count on a category page

Rather than adding shortcode you have to add the hook which is on the product category page: // Use this hook for working directly on category page // add_action( ‘woocommerce_archive_description’, ‘show_category_product_counts’, 10 ); // Use this shortcode hook if you want to put on anywhere in the category page if you are using Elementor/WPBakery add_shortcode( … Read more