WordPress auto picking featured image

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

Change get_post_thumb responsively?

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>’; ?>

Combining Post Thumbnails With Nivo Slider

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=”” />

Mass/Bulk assign featured images to posts

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

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