Featured image on post edit page not loading over HTTPS

It turned out to be a problem with the uploads directory (not sure what caused it initially). I was able to resolve the issue with the following filter: function fix_ssl( $url ) { if ( is_ssl() ) { if (stripos($url, ‘http://’) === 0) { $url=”https” . substr($url, 4); } } return $url; } function uploadDir($uploads) … Read more

Regenerate thumbnails for images that are not in the media library

wp-content/uploads images wont regenerate if they are not shown in the Media Library because those media ID’s needs to be there in the database.You need to first add your images on the media libray with the help of add-from-server plugin. Then with regenerate-thumbnails plugin you can then regenerate all of you images. Hope that helps!!

get_the_post_thumbnail_url(‘full’) returns empty from custom post type

The first argument for that function is not size. See the documentation (if a function’s not working, checking the documentation should always be your first step): get_the_post_thumbnail_url( int|WP_Post $post = null, string|array $size=”post-thumbnail” ) The first argument is which post the get the URL for, while the size is the second argument. To avoid redundancy, … Read more

how to post default thumbnail if post not created yet

Create “images” folder in current active theme the put “https://wordpress.stackexchange.com/questions/332635/dummy-image-1-1.jpg” in that folder. <?php if ($the_query->have_posts() ) : while ($the_query->have_posts()) : $the_query->the_post(); if ( has_post_thumbnail( ) ) { the_post_thumbnail( ‘full’, array( ‘class’ => ‘mySlides’ ) ); } else { ?> <img src=”https://wordpress.stackexchange.com/questions/332635/<?php echo get_template_directory_uri().”/images/dummy-image-1-1.jpg’; ?>” class=”mySlides” height=”350px”/> <?php } endwhile; else: ?> <img src=”https://wordpress.stackexchange.com/questions/332635/<?php echo … Read more

get_the_post_thumbnail(‘thumbnail-name’) always returns empty string

You’re using get_the_post_thumbnail() and not the nonexistent get_post_thumbnail() function, right? As JohnG said, you have to pass the ID of the current post to get_the_post_thumbnail() (the the_post_thumbnail() function already handles that for you). The Function Reference in the WordPress Codex has many usage examples: get_the_post_thumbnail($id); // without parameter -> Thumbnail get_the_post_thumbnail($id, ‘thumbnail’); // Thumbnail get_the_post_thumbnail($id, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)