Auto delete pictures in media library by age

You can use these functions to find and delete image attachments that are 3 days old since their date of creation: // Delete attachments (images) that are {n} days old. function auto_delete_old_image_atts() { // How many days old. $days = 3; // TRUE = bypasses the trash and force deletion. $force_delete = true; // Get … Read more

Can’t add image to site via php

While not really a WordPress issue, it is something we’re all probably going to have to deal with in developing. Check to make sure your ad blocker isn’t the problem. If it is, add your sites to the allowed list of domains so that you can still see what your site is supposed to look … Read more

Number of Style for Image Added into Post

I’m not sure if I understand your question correctly, but… In WP any attachment is a post (of attachment type). So 3109 is ID of that post. This means, that if you’ll take a look at wp_posts table, then you should find that post and there should be some additional info stored as meta fields … Read more

What did I do WRONG?

As explained in one of the comments to your question, the issue is how WP stored images (which are actually a kind of post). If you look at the Media on your developement/local site, you will see that each image has a URL that is related to your local URL. And each image is stored … Read more

download link for uploaded images for wordpress

You should just be able to use the HTML5 download attribute for that. So just make your links look like this: <a href=”https://wordpress.stackexchange.com/questions/331391/<?php echo wp_get_attachment_image_url($id); ?>” download>Download Image</a> where $id is the attachment ID

WordPress Featured Image meta box not showing

You might be facing this problem because your theme does not support featured images. But you can easily add that support, so no worries 🙂 To quote the WordPress Theme Handbook: Themes must declare support for the Featured Image function before the Featured Image interface will appear on the Edit screen. Support is declared by … Read more