WordPress does not load most theme images
WordPress does not load most theme images
WordPress does not load most theme images
WordPress Responsive Image ( srcset ) not work properly
Word press cutting sliding images – not displaying the entire image
This function is completely unnecessary, and can be replaced with the official WP function called media_sideload_image: media_sideload_image( string $file, int $post_id, string $desc = null, string $return = ‘html’ ) for example: $new_image_id = media_sideload_image( “https://example.com/image.png”, $post_id, “Toms great picture”, ‘ID’ ); https://developer.wordpress.org/reference/functions/media_sideload_image/ Don’t forget to check the result, if this fails it will return … Read more
media_handle_upload() with 1 image under 1Mb chokes my server and returns timeout error
You can achieve this by using following code: /* Automatically set the image Title, Alt-Text, Caption & Description upon upload ————————————————————————————–*/ add_action( ‘add_attachment’, ‘my_set_image_meta_upon_image_upload’ ); function my_set_image_meta_upon_image_upload( $post_ID ) { // Check if uploaded file is an image, else do nothing if ( wp_attachment_is_image( $post_ID ) ) { $custom_title = date(“Y-m-d”); //settings current date as … Read more
This post on the StudioPress forums mentions going to the Theme Settings in Genesis. Inside the Content Archives, click the checkbox that says “Display the featured image?”. On doing so, the featured image pops up.
If you want to get the actual images inside the post content, you can match them using a regular expression. To get just the images URLs and dimensions your code can be something like this: if( is_single() ) { global $post; // Match the image URLs inside the post content $pattern = ‘/<img.*src=”([^”]+)”[^>]*>/’; $matches = … Read more
The cause was WPML settings which dupplicates media. :/
Could be the piece you’re missing here is that after you upload photos if you want to get to that item again to do anything with it, including get its URL, the thing you need to keep is not the filename but the ID that you get back. You can then call e.g. wp_get_attachment_image_src directly … Read more