Images not loading after migration
Look at your folder “uploads” permissions, it should be 755. More information here.
Look at your folder “uploads” permissions, it should be 755. More information here.
The reason your generated size have larger size than the original image, is how the compression works. If you for example upload a low quality image that is 50kb is size, but your WordPress has JPG quality set to 100, then the thumbnails will size larger than the original image, since WordPress is not compressing … Read more
Resized different dimension image sets are generated by using wp_generate_attachment_metadata and wp_update_attachment_metadata method. $absFilename = $wp_upload_dir[‘path’].”https://wordpress.stackexchange.com/”.$filename; $attach_data = wp_generate_attachment_metadata( $attach_id, $absFilename); wp_update_attachment_metadata( $attach_id, $attach_data ); This will update the image details in the wp_postmeta table. Thanks @DaveRomsey
There is a ready function for doing such action: Take a look here: https://codex.wordpress.org/Function_Reference/wp_count_comments This should really sole your problem as you can use an if statement deciding the picture, just remember you have to use the post_id in order to get the count. Thank you!
I suppose you have Adaptive Images plugin installed? The author suggests for now: Can you check if the urls in your admin Settings > General page do contain the “https” instead of “http”? They should contain the “https” and (sorry about this inconvenience) you need to update your Adaptive Images settings one more time after … Read more
Your code is right just need to change $atts variable. // if you want to add image, alt attribute on shortcode statically $atts = shortcode_atts( array( ‘image_src’ => ”, ‘alt’ => ”, ‘add_img_class’ => ”, ‘id’ => ” ), $atts, ‘hero-banner’ ); // if you pass image and alt attribute dynamically $atts = shortcode_atts( array( … Read more
Change your function to this. function wpshout_custom_sizes($sizes) { $sizes[‘medium-width’] = __( ‘Medium Width’ ); $sizes[‘medium-height’] = __( ‘Medium Height’); $sizes[‘medium-something’] = __( ‘Medium Something’); return $sizes; } add_filter( ‘image_size_names_choose’, ‘wpshout_custom_sizes’ );
What you want is probably something like this. You need to manually unlink the original image including added sizes. The WP image editor automatically creates a new image with a new name as you mentioned but not others added through add_image_size() function. regenerate_added_sizes() in the code below does exactly that: function replace_original_images( $override, $filename, $image, … Read more
Thanks to you I tried this on my functions.php It worked, but also had to get the ID of the page, in my case 4. add_action( ‘woocommerce_before_main_content’, ‘woocommerce_category_image’, 2 ); function woocommerce_category_image() { if ( is_product_category() ){ global $wp_query; $cat = $wp_query->get_queried_object(); $thumbnail_id = get_term_meta( $cat->term_id, ‘thumbnail_id’, true ); $image = wp_get_attachment_url( $thumbnail_id ); if … Read more
Yes, just search for a specific image size within the theme files. The text editors like Atom, BBEdit, Notepad++ allows to do that. P.S. You can find image size name in add_image_size() function argument.