Instead of using $post, how do i get the thumbnail image of the $post

To grab the img tag as a variable: get_the_post_thumbnail ( int $post_id = null, string|array $size=”post-thumbnail”, string|array $attr=”” ) or if you want to outright echo it: the_post_thumbnail ( string|array $size=”post-thumbnail”, string|array $attr=”” ) Most things like the post content, excerpt, title etc, are acquired using functions like this so that filters and hooks can … Read more

Automatically add tag if a checkbox is checked

If I understand what you want I would call it on the save_post hook: https://codex.wordpress.org/Plugin_API/Action_Reference/save_post So the code would be something a little like: function wphuyeh8_save_post_tag( $post_id, $post, $update ) { // If example is set and not false if($_REQUEST[‘_example’]): // set the tag wp_set_post_tags( $post_ID, ‘example’, true ); else: // remove the tag if … Read more