Add Featured Image from Existing wp-content folder

While looking at some code for another issue I had a lightbulb went off in my head and brought me back to this problem. So after several tries at it I came up with this… function add_image_to_feed( $thumbz){ if( is_feed() ){ $def_thmb = get_post_meta( get_the_ID(),’def_thmb’,true); $subPath = tube_sub_dir_path(get_the_ID()); $upload_dir = wp_upload_dir(); $thumb_ur = $upload_dir[baseurl].”/tube-thumbs/”.$subPath.””; $thumbz … Read more

Page featured image not showing on home page

I think you’d need to get the actual page object and find the ID from there. Then, you can pass that ID to the_post_thumbnail(), otherwise I think the ID of a post in the loop will be used, not the actual home page. Try this $page_object = get_queried_object(); to get info about your home page.

Thumbnail size according to width and height

add_image_size doesn’t do what you think it does. It doesn’t add an image of size X to a thumbnail, rather it registers an image size, and its associated dimensions. register_image_size may well have been the more appropriate name for this function. As a result, you need to register all your image sizes, on every page … Read more