media sideload image and Google Content
I did a little searching and it looks like maybe you can fix it by appending ?.jpg to the end of the URL. According to this guide that gets around most URL parsers
I did a little searching and it looks like maybe you can fix it by appending ?.jpg to the end of the URL. According to this guide that gets around most URL parsers
Emoji are just letters. They’re defined by the user’s operating system. The same way the alphabet is. You don’t need to do anything special. If you did, then that website would be pointless. The only thing you need to consider is older operating systems that don’t support Emoji, but WordPress itself loads a script that … Read more
Are you using a theme that has WooCommerce support? Look for: woocommerce_get_product_thumbnail and replace it with the_post_thumbnail This has worked before for me with A3 Lazy Load plugin.
The main problem here is what exactly was removed. If only thumbnails, then you can always regenerate them and everything should work OK. If all files are missing, then you can check if attached file is missing using this code: if ( file_exists( get_attached_file ( get_post_thumbnail_id( $post_id ) ) ) { // file exists } … Read more
You were very close. You just had a single-quote swapped with a double-quote after the onmouseover. <figure class=”wp-block-image”> <img src=”https://website.com/wp-content/uploads/2019/08/image1.png” onmouseover=”this.src=”https://website.com//wp-content/uploads/2019/08/image2.png”;” onmouseout=”this.src=”https://website.com/wp-content/uploads/2019/08/image1.png”;” alt=”alttext” class=”wp-image-1111″/> </figure> I usually place semi-colons after the single-quotes to make it easier to tell when your quotes are balanced, whether Javascript requires it, or not.
I solved this by removing the figure element around the image and applying style=”padding-bottom: calc((height/width)*100%); position: relative” to the <div class=”img_container” instead, which contains both the placeholder and the hover image.
Take a look at wp_upload_dir here https://developer.wordpress.org/reference/functions/wp_upload_dir/ $upload_dir = wp_upload_dir(); var_dump( $upload_dir ); /* $upload_dir will comprise of the following return values: ‘path’ – (string) Base directory and subdirectory or full path to upload directory. ‘url’ – (string) Base URL and subdirectory or absolute URL to upload directory. ‘subdir’ – (string) Subdirectory if uploads use … Read more
Fastest way in my opinion would be to apply filter on the_content with preg_replace_callback to find media URLs and replace them with anything else, like attachment pages. Attachment ID is available as part of <img> class value as well as wp:image attribute in Gutenberg comment. So you just need some smart regexp to match each … Read more
Basically, I was being totally stupid and had two alt tags that’s why it didn’t work.
There’s a few functions: wp_get_attachment_image_url( $attachment_id, $size ) – Gets the URL to specified size of the image. wp_get_attachment_image_src( $attachment_id, $size ) – Gets an array of the image URL, width, and height for the specified size of the image. wp_get_attachment_image( $attachment_id, $size ) – Gets the full HTML for an image, including width, height, … Read more