Pointing Existing featured images to s3 bucket
Pointing Existing featured images to s3 bucket
Pointing Existing featured images to s3 bucket
This widget class uses the functionwp_widget_rss_output(), and there is no filter to change its output. So the answer is: no. But you can create your own RSS widget and replace the default widget with an improved version.
You need to create a function for that. Use this code below in your functions.php file and it will add a featured image automatically: /* Generate Featured Image Automatically */ function autoset_featured() { global $post; $already_has_thumb = has_post_thumbnail($post->ID); if (!$already_has_thumb) { $attached_image = get_children( “post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1” ); if ($attached_image) { foreach ($attached_image as $attachment_id => $attachment) … Read more
You can do this by using conditionals for mobile ie: wp_is_mobile() Define both the sizes like add_image_size( ‘featured-cat’, 248, 110, true ); //featured-cat add_image_size( ‘featured-cat-mobile’, 200, 80, true ); //featured-cat mobile and edit the code like the below:– <?php echo ‘<div class=”featured-thumbnail”>’; if( wp_is_mobile() ) the_post_thumbnail(‘featured-cat-mobile’,array(‘title’ => ”)); else the_post_thumbnail(‘featured-cat’,array(‘title’ => ”)); echo ‘</div>’; ?>
the_post_thumbnail() displays the featured image. get_the_post_thumbnail() retrieves it for use in code. Try something like this: <?php $featured_image = get_the_post_thumbnail( get_the_ID() ); $fi_src = $featured_image[‘src’]; $slider = get_the_post_thumbnail( get_the_ID(), ‘sliderimage’ ); $s_src = $slider[‘src’]; ?> <img src=”https://wordpress.stackexchange.com/questions/130312/<?php echo $fi_src; ?>” data-thumb=””<?php echo $s_src; ?> title=”” />
Fetching full size featured image to insert in RSS Feed
Worse thumbnail quality after GD library install
It seems it was a theme error. As per Oblaksoft, it assumes that all images reside on the server’s file system and doesn’t work with images in the cloud. It’s hard when a theme is not fully compatible with WordPress hosted under Amazon EC2. =(
You’re trying to display the post thumbnail for the attachment itself: wp_get_attachment_url( get_post_thumbnail_id( 3400 ) ) Instead, use: wp_get_attachment_url( get_post_thumbnail_id( 2300 ) )
As you don’t have much programming experience, I’ll post a ready-to-use solution here. I’ve looked at your code a little longer, and the problem is that after array_shift, $ids is still an array. set_post_thumbnail expects and integer, not an array. You could use $ids[0] as the second parameter, but the following is a cleaner solution, … Read more