Trying to create a mouseover effect in html using Gutenberg editor

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.

Is there a way to dynamically get to your uploads folder?

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

How to get specific image in media library with php

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

Can an image have more than one parent_post?

Images can only be attached to a single post, and they only get attached to the post they were originally uploaded to, and only if it was uploaded to a particular post to begin with. The only way to know if an image is used by a post is to parse the HTML of the … Read more

How can I upload an image for background use using the Theme Editor in WordPress?

Giving the CSS of background #FFFFFF url(‘images/newbackground.gif’); is just giving an example based on basic CSS. Be careful when copying the suggestions made in the book because you missed an important colon after background. It should be background: #FFFFFF url(‘images/newbackground.gif’); Also, you need to make sure the URL part of the CSS is correct for … Read more