Link from Thumbnail to Post not working

You probably have more than one query in your page, let’s make sure we are working with this query: <?php $carouselPosts = new WP_Query(); $carouselPosts->query(‘showposts=3’); // checking if there are posts to show if($carouselPosts->posts){ foreach ($carouselPosts->posts as $carouselPost) { echo ‘<a href=”‘. get_permalink($carouselPost->ID). ‘”>’; echo ‘<div class=”recentpostthumbnail”>’; echo get_the_post_thumbnail($carouselPost->ID,array(70,70)); echo ‘</div>’; echo ‘</a>’; $excerpt = … Read more

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