wp_localize_script no longer working after 5.5 update

I just had this issue myself and was able to fix it by assigning it to the script that required the data and not to “jquery”, example below: wp_localize_script(‘jquery’, ‘vars’, $vars); wp_localize_script( ‘replace-with-your-script-name’, ‘vars’, $vars); To clarify: This would be the same name that was used to identify in wp_enqueue_script() and should match it.

Display the 3 latest WordPress Posts on a Static Page Outside WordPress

Set this to 3: ‘posts_per_page’ => 3 Add your div in loop require($_SERVER[‘DOCUMENT_ROOT’] . ‘/blog/wp-load.php’); $args = array( // ‘cat’ => 3, // Only source posts from a specific category ‘posts_per_page’ => 3 // Specify how many posts you’d like to display ); $latest_posts = new WP_Query( $args ); if ( $latest_posts->have_posts() ) { while … Read more

How to give each category name its own ACF background color?

The syntax to get the ACF field of a custom taxonomy is: $var = get_field(‘name_of_acf_field’, ‘name_of_taxonomy’ . ‘_’ . taxonomy_ID); so in your case you’ll need to get product_cat ID before and do something like: add_action( ‘woocommerce_shop_loop_item_title’, ‘VS_woo_loop_product_title’, 10 ); function VS_woo_loop_product_title() { echo ‘<h3>’ . get_the_title() . ‘</h3>’; $terms = get_the_terms( $post->ID, ‘product_cat’ ); … Read more

WordPress Hacked 5.5 admin-ajax.php [closed]

Attempt to access the login page happen all the time. Not a big deal….assuming that you have proper protections. Like: Not having a user named ‘admin’ Not allowing enumeration of user names (so user names aren’t discoverable) Using strong passwords on all accounts, especially admin-level Using strong passwords on hosting, FTP, database, etc Disabling access … Read more

Partial img lazy load with WP 5.5

Whether or not the loading=”lazy” attribute will be added to images from these plugins depends entirely on how those plugins are outputting their images. As outlined in this blog post, WordPress 5.5 only adds the loading=”lazy” attribute automatically to the following images: images within post content (the_content) images within post excerpts (the_excerpt) images within text … Read more