Recent posts on homepage: different thumbnail based on logged in status and post category

This works well on archive.php, but not working on the homepage. For some reason, the first statement doesn’t get applied: if a post is in Members category and user is not logged in, it’s supposed to show a default placeholder image, but instead it’s still showing the actual post thumbnail.

Get terms of a taxonomy using useSelect

I’m developing a Gutenberg block and I need to show a dropdown with all the terms of a custom taxonomy in it. I’m using the useSelect hook for retrieving this data, but it’s not working because it gets stuck showing the Loading... message and there are no errors in the console. I registered the taxonomy with the show_in_rest arg set to true.

Increment integer field in database when WHERE needs to be dynamic

I have a database column called “upvotes”. I have another column called “userid”. I would like to increment the value in the “updates” column where the userid matches the dynamic variable I’m providing. Here’s my attempt: $results = $wpdb->query("UPDATE points SET upvotes = upvotes + 1 WHERE userid= %d", $theDynamicUserID); That is giving the following … Read more